Go to file
openharmony_ci 0856290a3a
!2 README.OpenSource 中License信息整改
Merge pull request !2 from peizhe/master
2023-05-05 02:26:29 +00:00
benches add throughput benchmark 2019-02-20 11:57:47 -08:00
src v0.3.0 2019-08-20 11:59:30 -07:00
.gitignore initial commit 2018-03-15 15:26:45 -07:00
BUILD.gn Add GN Build Files and Custom Modifications 2023-04-18 18:15:41 +08:00
Cargo.toml v0.3.0 2019-08-20 11:59:30 -07:00
LICENSE v0.2.0 2019-03-19 12:44:42 -07:00
README.md v0.2.0 2019-03-19 12:44:42 -07:00
README.OpenSource README.OpenSource 中License信息整改 2023-05-04 11:31:30 +08:00

Want

A Futures channel-like utility to signal when a value is wanted.

Futures are supposed to be lazy, and only starting work if Future::poll is called. The same is true of Streams, but when using a channel as a Stream, it can be hard to know if the receiver is ready for the next value.

Put another way, given a (tx, rx) from futures::sync::mpsc::channel(), how can the sender (tx) know when the receiver (rx) actually wants more work to be produced? Just because there is room in the channel buffer doesn't mean the work would be used by the receiver.

This is where something like want comes in. Added to a channel, you can make sure that the tx only creates the message and sends it when the rx has poll() for it, and the buffer was empty.

License

want is provided under the MIT license. See LICENSE.