https://github.com/tailhook/async-slot
An unbounded channel that only stores last value sent made for futures-rs
https://github.com/tailhook/async-slot
Last synced: about 1 year ago
JSON representation
An unbounded channel that only stores last value sent made for futures-rs
- Host: GitHub
- URL: https://github.com/tailhook/async-slot
- Owner: tailhook
- License: apache-2.0
- Created: 2017-10-25T19:52:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-25T20:33:08.000Z (over 8 years ago)
- Last Synced: 2025-03-11T19:49:01.029Z (over 1 year ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
Async Slot
==========
[Documentation](https://docs.rs/async-slot) |
[Github](https://github.com/tailhook/async-slot) |
[Crate](https://crates.io/crates/async-slot)
An unbounded channel that only stores last value sent made for [futures].
[futures]: https://github.com/alexcrichton/futures-rs
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
* Apache License, Version 2.0,
(./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
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.