This is a tool for managing asynchronous tasks.
For example, maybe you have some periodic background tasks, plus a couple web servers. Using a TaskManager
you can group these and shut them down as a group, gracefully, and wait for them all to end.
Handles
- Long tasks
- Simple periodic tasks (fixed sleep between invocations)
- Async streams
- Ctrl+c shutdown
Use it like
let tm = new;
tm.attach_sigint;
let tm1 = tm.clone;
let log2 = logger.clone;
tm.task;
tm.join.await;