supervisors: Monitor groups of threads with non-hierarchical lifetimes.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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:

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.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.2.0.0, 0.2.1.0
Change log CHANGELOG.md
Dependencies async (>=2.2.1 && <2.3), base (>=4.11 && <4.13), containers (>=0.5.9 && <0.7), safe-exceptions (>=0.1.7 && <0.2), stm (>=2.5 && <2.6) [details]
License MIT
Copyright 2018 Ian Denhardt
Author Ian Denhardt
Maintainer ian@zenhack.net
Category Concurrency
Home page https://github.com/zenhack/haskell-supervisors
Bug tracker https://github.com/zenhack/haskell-supervisors/issues
Source repo head: git clone https://github.com/zenhack/haskell-supervisors.git -b master
Uploaded by isd at 2018-12-18T22:57:06Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for supervisors-0.2.0.0

[back to package description]

hackage

Haskell Supervisors

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.

One way to think of it is that supervisors is to async as resourcet is to bracket.

Most of the time you can manage these things in a hierarchical manner: for bracket, acquire a resource, do stuff with it, and release it. For async, spawn some tasks, wait for some or all of them, maybe kill the remaining ones, and return. The memory used by all of these threads is not reclaimed until the entire subtree finishes.

But sometimes, your concurrency patterns don't fit neatly into a tree; that is what this package is for.

This package was originally written for use in the rpc layer of the capnp package, where the various threads handling rpc calls can have essentially arbitrary lifetimes, but we often want to make sure they are all shut down when a connection is closed.

Concretely, the library provides a Supervisor construct, which can be used to safely spawn threads while guaranteeing that: