summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync/mpsc/mod.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2020-09-24 17:26:38 -0700
committerGitHub <noreply@github.com>2020-09-24 17:26:38 -0700
commitcf025ba45f68934ae2138bb75ee2a5ee50506d1b (patch)
tree39fa03f4b063402e84da4435ebca39bd21266ad2 /tokio/src/sync/mpsc/mod.rs
parent4186b0aa38abbec7670d53882d5cdfd4b12add5c (diff)
sync: support mpsc send with `&self` (#2861)
Updates the mpsc channel to use the intrusive waker based sempahore. This enables using `Sender` with `&self`. Instead of using `Sender::poll_ready` to ensure capacity and updating the `Sender` state, `async fn Sender::reserve()` is added. This function returns a `Permit` value representing the reserved capacity. Fixes: #2637 Refs: #2718 (intrusive waiters)
Diffstat (limited to 'tokio/src/sync/mpsc/mod.rs')
-rw-r--r--tokio/src/sync/mpsc/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/sync/mpsc/mod.rs b/tokio/src/sync/mpsc/mod.rs
index 7e663da8..a2bcf83b 100644
--- a/tokio/src/sync/mpsc/mod.rs
+++ b/tokio/src/sync/mpsc/mod.rs
@@ -76,7 +76,7 @@
pub(super) mod block;
mod bounded;
-pub use self::bounded::{channel, Receiver, Sender};
+pub use self::bounded::{channel, Permit, Receiver, Sender};
mod chan;