immortal: Spawn threads that never die (unless told to do so)

[ concurrency, library, mit ] [ Propose Tags ]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.1, 0.2, 0.2.2,, 0.3
Change log
Dependencies base (>=4.5 && <5), lifted-base (>=0.2), monad-control (>=0.3), transformers-base (>=0.4) [details]
License MIT
Author Roman Cheplyaka
Category Concurrency
Home page
Uploaded by RomanCheplyaka at 2014-08-10T14:03:35Z
Distributions LTSHaskell:0.3, NixOS:0.3, Stackage:0.3
Reverse Dependencies 6 direct, 1 indirect [details]
Downloads 6475 total (61 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]

Readme for immortal-0.2

[back to package description]


A small library to create threads that never die. This is useful e.g. for writing servers.

import qualified System.Immortal as Immortal
import Control.Concurrent (threadDelay)
import Control.Monad (forever)

main = do
  -- start an immortal thread
  _ <- Immortal.create $ do
    -- do stuff

  -- in the main thread, sleep until interrupted
  -- (e.g. with Ctrl-C)
  forever $ threadDelay maxBound