The immortal package

[Tags:library, mit, test]

[Skip to Readme]

Properties

Versions 0.1, 0.2, 0.2.2
Change log CHANGELOG.md
Dependencies base (>=4.5 && <5), lifted-base (>=0.2), monad-control (>=0.3), stm, transformers-base (>=0.4) [details]
License MIT
Author Roman Cheplyaka
Maintainer roma@ro-che.info
Category Concurrency
Home page https://github.com/feuerbach/immortal
Uploaded Thu Mar 17 10:25:27 UTC 2016 by RomanCheplyaka
Distributions LTSHaskell:0.2.2, NixOS:0.2.2, Stackage:0.2.2, Tumbleweed:0.2.2
Downloads 781 total (29 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-03-17 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for immortal

Readme for immortal-0.2.2

immortal

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
  _thread <- Immortal.create $ \ _thread -> do
    -- do stuff

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