immortal

Spawn threads that never die (unless told to do so) https://github.com/feuerbach/immortal

Version on this page:0.2
LTS Haskell 15.13:0.3
Stackage Nightly 2020-05-23:0.3
Latest on Hackage:0.3

See all snapshots immortal appears in

MIT licensed by Roman Cheplyaka
Maintained by [email protected]

Module documentation for 0.2

This version can be pinned in stack with:[email protected]:b6ad55fe5a1744f83dde34f0f7ad603313f28d30e0f3a41f8aaea4b0a955bc71,1197

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

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

Changes

CHANGES

Version 0.2

  • Pass a Thread handle to the thread itself
  • Add mortalize, immortalize