An open API service indexing awesome lists of open source software.

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

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.