{"id":17537518,"url":"https://github.com/zenhack/haskell-supervisors","last_synced_at":"2026-03-06T02:31:35.129Z","repository":{"id":56879506,"uuid":"157023491","full_name":"zenhack/haskell-supervisors","owner":"zenhack","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-03T23:35:09.000Z","size":18,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T00:20:38.546Z","etag":null,"topics":["haskell"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenhack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-10T21:34:13.000Z","updated_at":"2023-07-04T14:45:44.000Z","dependencies_parsed_at":"2023-02-18T12:16:12.628Z","dependency_job_id":null,"html_url":"https://github.com/zenhack/haskell-supervisors","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenhack%2Fhaskell-supervisors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenhack%2Fhaskell-supervisors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenhack%2Fhaskell-supervisors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenhack%2Fhaskell-supervisors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenhack","download_url":"https://codeload.github.com/zenhack/haskell-supervisors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242245250,"owners_count":20096073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell"],"created_at":"2024-10-20T20:42:05.610Z","updated_at":"2026-03-06T02:31:30.103Z","avatar_url":"https://github.com/zenhack.png","language":"Haskell","readme":"[![hackage][hackage-img]][hackage]\n\n# Haskell Supervisors\n\nThe `supervisors` package provides a useful abstraction for managing the\ngroups of Haskell threads, which may not have a strictly hierarchical\nstructure to their lifetimes.\n\nOne way to think of it is that `supervisors` is to [async][async] as\n[resourcet][resourcet] is to [bracket][bracket].\n\nMost of the time you can manage these things in a hierarchical manner:\nfor bracket, acquire a resource, do stuff with it, and release it. For\nasync, spawn some tasks, wait for some or all of them, maybe kill the\nremaining ones, and return. The memory used by all of these threads is\nnot reclaimed until the entire subtree finishes.\n\nBut sometimes, your concurrency patterns don't fit neatly into a tree;\nthat is what this package is for.\n\nThis package was originally written for use in the rpc layer of the\n[capnp][capnp] package, where the various threads handling rpc calls\ncan have essentially arbitrary lifetimes, but we often want to make\nsure they are all shut down when a connection is closed.\n\nConcretely, the library provides a `Supervisor` construct, which can be\nused to safely spawn threads while guaranteeing that:\n\n* When the supervisor is killed, all of the threads it supervises will be\n  killed.\n* Child threads can terminate in any order, and memory usage will always\n  be proportional to the number of *live* supervised threads.\n\n[async]: https://hackage.haskell.org/package/async\n[bracket]: http://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Exception-Base.html#v:bracket\n[resourcet]: https://hackage.haskell.org/package/resourcet\n[capnp]: https://hackage.haskell.org/package/capnp\n\n[hackage-img]: https://img.shields.io/hackage/v/supervisors.svg\n[hackage]: https://hackage.haskell.org/package/supervisors\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenhack%2Fhaskell-supervisors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenhack%2Fhaskell-supervisors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenhack%2Fhaskell-supervisors/lists"}