#preserve #future #slot #async #tokio #unbounded-channel

async-slot

An asynchronous (futures-based) channel that only preserves last value sent

1 unstable release

Uses old Rust 2015

0.1.0 Oct 25, 2017

#8 in #unbounded-channel

Download history 24/week @ 2024-07-20 38/week @ 2024-07-27 23/week @ 2024-08-03 28/week @ 2024-08-10 24/week @ 2024-08-17 26/week @ 2024-08-24 35/week @ 2024-08-31 12/week @ 2024-09-07 14/week @ 2024-09-14 31/week @ 2024-09-21 17/week @ 2024-09-28 8/week @ 2024-10-05 25/week @ 2024-10-12 18/week @ 2024-10-19 11/week @ 2024-10-26 26/week @ 2024-11-02

81 downloads per month
Used in 8 crates (2 directly)

MIT/Apache

21KB
247 lines

Async Slot

Documentation | Github | Crate

An unbounded channel that only stores last value sent made for futures.

Features:

  1. Compacts memory (only last value is kept)
  2. Has poll_cancel and is_canceled
  3. Single-producer/single-consumer
  4. Never has backpressure (because value is just replaced)
  5. Replaced value can be recovered if using swap method.
  6. Sync, so if multi-producer is desired, Sender can be wrapped into an Arc/Rc and swap method is used to update value.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~54KB