Questions tagged [rust-tokio]

Tokio is an event-driven, non-blocking I/O platform for writing asynchronous applications with the Rust programming language.

Tokio aims to be:

  • Fast: Tokio's zero-cost abstractions give you bare-metal performance.

  • Productive: Tokio makes it easy to implement protocols and program asynchronously.

  • Reliable: Tokio leverages Rust's ownership and concurrency model to ensure thread safety.

  • Scalable: Tokio has a minimal footprint, and handles backpressure and cancellation naturally.

At a high level, it provides a few major components:

  • A multithreaded, work-stealing based task scheduler.
  • A reactor backed by the operating system's event queue (epoll, kqueue, IOCP, etc...).
  • Asynchronous TCP and UDP sockets.

You can find more information in

1053 questions
-2
votes
1 answer

tokio-curl: capture output into a local `Vec` - may outlive borrowed value

I do not know Rust well enough to understand lifetimes and closures yet... Trying to collect the downloaded data into a vector using tokio-curl: extern crate curl; extern crate futures; extern crate tokio_core; extern crate tokio_curl; use…
estin
  • 3,051
  • 1
  • 24
  • 31
-3
votes
2 answers

Tokio receiver cannot read from channel unless sender task task has any "await" in its closure. Potential bug or a quirk in tokio?

Code: use std::thread; use chrono::Utc; use tokio::sync::watch::Receiver; use std::time::Duration; use tokio::sync::watch; use tokio::time::sleep; pub fn get_now_formatted() -> String { Utc::now().format("%Y-%m-%d…
SpaceMonkey
  • 4,143
  • 5
  • 38
  • 60
-3
votes
1 answer

Connection reset by peer. Tokio, select

I am writing socks5 proxy server. The program is running asynchronously and I am trying to use tokio::select, but the program terminates due to this error when I want to get the size of the received data: thread 'tokio-runtime-worker' panicked at…
1 2 3
70
71