https://github.com/restioson/umthombo
Select from a fountain of futures
https://github.com/restioson/umthombo
Last synced: over 1 year ago
JSON representation
Select from a fountain of futures
- Host: GitHub
- URL: https://github.com/restioson/umthombo
- Owner: Restioson
- Created: 2020-09-14T19:29:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-14T20:08:02.000Z (almost 6 years ago)
- Last Synced: 2025-02-01T12:29:17.078Z (over 1 year ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This crate does not actually work
I'm talking, like, don't use this please. It does not work. This was just An Attempt made in about an hour and I will Not Be Fixing It. Feel free to fork it though.
# umthombo
Select over two or three "streams" of futures, only polling whichever is woken.
## Motivation
1. Why not just use `Stream` select? This is because while `Future`s have a `drop`, `Stream`s do not have a "`poll_cancel`".
This means that for channels which have stream impls, they have to *always notify every stream*, lest one of them has
since stopped polling and released the "resource" that is a message. This can make selecting over `Stream`s undesireable.
This is one of the niches that umthombo fills, until such a time as streams get a `poll_cancel` method or similar,
or indefinitely.
2. The second reason for umthombo's existence is to lower the overhead of selecting when both futures should not be
eagerly polled, but one is still more important than another. Umthombo will only poll woken futures, but it will also
prefer to poll the futures in order.