🌐
Docs
docs.rs › tokio › latest › tokio › sync › mpsc › index.html
tokio::sync::mpsc - Rust
A multi-producer, single-consumer queue for sending values between asynchronous tasks.
🌐
Rust-lang
users.rust-lang.org › help
Axum / tokio shared state channel confusion - help - The Rust ...
November 13, 2021 - I seem to have a conflict between sharing state in Axum, and using a tokio::sync channel rather than a std:sync channel. Tokio says I should be using a tokio::sync channel to communicate between synchronous and asynchronous code ( I understand because it's wrong to block in sync code ). However ...
🌐
Reddit
reddit.com › r/rust › tokio's axum web framework - not new, but new to me
r/rust on Reddit: Tokio's Axum web framework - not new, but new to me
January 22, 2022 - 148 votes, 33 comments. 279K subscribers in the rust community. A place for all things related to the Rust programming language—an open-source…
🌐
Tokio
tokio.rs › tokio › tutorial › channels
Channels | Tokio - An asynchronous Rust runtime
The mpsc channel is used to send commands to the task managing the redis connection. The multi-producer capability allows messages to be sent from many tasks. Creating the channel returns two values, a sender and a receiver. The two handles are used separately.
🌐
Docs
docs.rs › tokio › latest › tokio › sync › mpsc › fn.channel.html
channel in tokio::sync::mpsc - Rust
Creates a bounded mpsc channel for communicating between asynchronous tasks with backpressure.
🌐
GitHub
github.com › tokio-rs › axum
GitHub - tokio-rs/axum: Ergonomic and modular web framework built ...
axum is a relatively thin layer on top of hyper and adds very little overhead. So axum's performance is comparable to hyper. You can find benchmarks here and here. This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.
Starred by 19.500 users
Forked by 1100 users
Languages: Rust
🌐
Tokio
tokio.rs › blog › 2023-11-27-announcing-axum-0-7-0
Announcing axum 0.7.0 | Tokio - An asynchronous Rust runtime
Tokio is a runtime for writing reliable asynchronous applications with Rust. It provides async I/O, networking, scheduling, timers, and more.
🌐
Stack Overflow
stackoverflow.com › questions › 61168507 › wrapping-blocking-mpsc-in-async-rust-tokio
Wrapping blocking mpsc in async Rust (Tokio) - Stack Overflow

I've posted a separate thread on a rust-lang community and got an answer there.

std::sync::mpsc::channel can be swapped to tokio::sync::mpsc::unbounded_channel, which has a non-async send method. It solves the issue.

Answer from Kirill Dubovikov on stackoverflow.com
🌐
Docs
docs.rs › axum › latest › axum
axum - Rust
Router is used to set up which paths goes to which services: use axum::{Router, routing::get}; // our router let app = Router::new() .route("/", get(root)) .route("/foo", get(get_foo).post(post_foo)) .route("/foo/bar", get(foo_bar)); // which calls one of these handlers async fn root() {} async ...
🌐
GitHub
github.com › philschmid › axum-tokio-mpsc
GitHub - philschmid/axum-tokio-mpsc
Contribute to philschmid/axum-tokio-mpsc development by creating an account on GitHub.
Author: philschmid
Find elsewhere
🌐
Tokio
tokio.rs › blog › 2021-07-announcing-axum
Announcing Axum | Tokio - An asynchronous Rust runtime
Tokio is a runtime for writing reliable asynchronous applications with Rust. It provides async I/O, networking, scheduling, timers, and more.
🌐
Tokio
tokio.rs › blog › 2019-10-scheduler
Making the Tokio scheduler 10x faster | Tokio - An asynchronous ...
The amount of time processors spend executing the task far outweighs the amount of time spent popping the task from the run queue. When tasks execute for a long period of time, queue contention is reduced. However, Rust's asynchronous tasks are expected to take very little time executing when ...
🌐
GitHub
github.com › tokio-rs › axum › discussions › 1159
Question: Multiple concurrent writes to a SplitSink · tokio-rs/axum ...
Following from the websocket chat example provided, we are able to receive messages and send messages independent of each other. My currently use-case would need to take this a step further, where ...
Author: tokio-rs
🌐
Understand Axum
rust-api.dev › docs › part-1 › tokio-hyper-axum
Understand Axum | rust-api.dev
May 1, 2021 - In this chapter you will acquire ... of the Axum, Tower and Hyper crates, these are the libraries underlying our application server. Your will learn how to compose middleware layers to add cross-cutting features to your API endpoints. ... Our web application will be completely based on the tokio.rs family ...
🌐
Medium
medium.com › learning-rust › hello-world-server-8ad299d36cf5
Hello World server- Rust, Tokio & Axum | Learning Rust
December 19, 2023 - Let’s take the first steps to Build a Dockerized RESTful API application in Rust. We’ll start with cargo, Tokio & Axum; then let’s Dockerize our web server.
🌐
GitHub
github.com › tokio-rs › axum › discussions › 604
confused about the websocket/chat example model · tokio-rs/axum ...

Does the chat example help https://github.com/tokio-rs/axum/blob/main/examples/chat/src/main.rs?

Author: tokio-rs
🌐
Stack Overflow
stackoverflow.com › questions › 75756941 › is-axum-with-tokio-disabled-still-asynchronous
rust - Is Axum, with Tokio disabled, still asynchronous? - Stack ...

A function is asynchronous if it is defined as such (async keyword) or returns a Future with the former more or less being syntax sugar for the latter, tokio is merely a runtime to run futures for you (it polls them until they are finished), it's presence is orthogonal to something being asynchronous.

Answer from cafce25 on stackoverflow.com
🌐
Reddit
reddit.com › r/rust › new tokio blog post: announcing axum 0.6.0
r/rust on Reddit: New Tokio blog post: Announcing axum 0.6.0
November 25, 2022 - 618 votes, 45 comments. 319K subscribers in the rust community. A place for all things related to the Rust programming language—an open-source…
🌐
Reddit
reddit.com › r/rust › tachyonix: a very fast mpsc async bounded channel
r/rust on Reddit: Tachyonix: a very fast MPSC async bounded channel

Looks great, thank you for releasing it as a standalone crate! I'm happy to see an in-depth discussion of the trade-offs between various implementations.

Does it use fences or inline assembly for synchronization? I'm asking because they usually cause false positives on Thread Sanitizer, which is my go-to tool for testing concurrency because you can run entire real-world programs with it with reasonable performance (unlike loom or miri).