python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
async fn calling split generates error "borrowed value does not live long enough"
I've created a contrived example to understand an error I'm seeing with an async function using tokio:
pub async fn unique_words_async() -> io::Result<u32> {
let file = File::open("s...
Ultrasaurus
Votes: 0
Answers: 1
confusion about tokio/bytes::BytesMut
from the doc:
BytesMut represents a unique view into a potentially shared memory region. Given the uniqueness guarantee, owners of BytesMut handles are able to mutate the memory.
BytesMut can be th...
linuxfish
Votes: 0
Answers: 1
How to run multiple Tokio async tasks in a loop without using tokio::spawn?
I built a LED clock that also displays weather. My program does a couple of different things in a loop, each thing with a different interval:
updates the LEDs every 50ms,
checks the light level (to a...
TPReal
Votes: 0
Answers: 2
How do I resolve the "`Unpin` is not implemented for `from_generator..." problem when implementing a TCP concurrent connector?
I want to implement a concurrent TCP connector using Tokio. The function should initialize multiple outbound connections and only return the one that finishes the handshake first (and drop all other c...
tavimori
Votes: 0
Answers: 0