The supervisors package provides a useful abstraction for managing the
groups of Haskell threads, which may not have a strictly hierarchical
structure to their lifetimes.
Concretely, the library provides a Supervisor construct, which can be
used to safely spawn threads while guaranteeing that:
When the supervisor is killed, all of the threads it supervises will be
killed.
Child threads can terminate in any order, and memory usage will always
be proportional to the number of *live* supervised threads.
One way to think of it is that supervisors is to async as
resourcet is to bracket.
Note that this package is EXPERIMENTAL; it needs more careful testing before
I can earnestly recommend relying on it.
See the README and module documentation for more information.