Async Timeouts Helper
It is a simple instrument to delay execution of an async task with additional methods:
- reset timeout with a new value, i.e. to delay execution of your task;
- restart timeout with a new or previous task;
- stop the timer before your task will be executed;
- finished — check if the timer of the task is over or not.
It is convinient to use this crate with Notify or different channels (i.e. async_channel).
Example
use ;
use Timeout;
use Notify;
use Arc;
async
Take a look at more complex examples: