#futures #tokio

strawpoll

A wrapper to avoid spurious polling

5 releases

0.2.2 Apr 16, 2020
0.2.1 Feb 4, 2020
0.2.0 Feb 4, 2020
0.1.1 Feb 4, 2020
0.1.0 Feb 4, 2020

#358 in Asynchronous

Download history 11/week @ 2020-11-07 14/week @ 2020-11-14 21/week @ 2020-11-21 45/week @ 2020-11-28 41/week @ 2020-12-05 21/week @ 2020-12-12 47/week @ 2020-12-19 11/week @ 2020-12-26 26/week @ 2021-01-02 66/week @ 2021-01-09 121/week @ 2021-01-16 133/week @ 2021-01-23 169/week @ 2021-01-30 217/week @ 2021-02-06 174/week @ 2021-02-13 82/week @ 2021-02-20

72 downloads per month
Used in noria-server

MIT/Apache

14KB
183 lines

Crates.io Documentation Build Status Codecov


Strawpoll — a wrapper to avoid spurious polling.

Sometimes, you have a future that itself contains smaller futures. When the larger future is polled, it polls those child futures to see if any of them have made progress. This can be inefficient if polling such a future is expensive; when the big future is woken up, it is usually because one of its child futures was notified, and ideally only that one future should be polled. Polling the other child futures that were not notified is wasting precious cycles. This crate provides a wrapper for Future types, and other types that you may wish to call poll-like methods on that avoids such spurious calls to poll.

License

Licensed under either of

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.

Dependencies

~24KB