TylerBloom/troupe

Cancelable timers, streams, and futures

Opened this issue · 0 comments

Currently, there is no way to cancel streams, timers, and futures that are queued in the scheduler. This should be fairly easy to implement. futures-rs provides an Abortable wrapper for futures and streams. A wrapper around the Abort struct (used to abort an Abortable future/stream) can be given to the caller. This wrapper would contain an ID and implement helpful traits like Hash, Eq, etc using this id. The scheduler can then implement an abort method that takes this wrapper, aborts the future, and decrements its internal counter.