@hackage immortal0.2.2
Spawn threads that never die (unless told to do so)
Categories
License
MIT
Maintainer
roma@ro-che.info
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
Installation
Dependencies (5)
- base >=4.5 && <5
- lifted-base >=0.2
- monad-control >=0.3
- stm
- transformers-base >=0.4 Show all…
Dependents (8)
@hackage/wrecker, @hackage/immortal-worker, @hackage/freckle-app, @hackage/acme-everything, @hackage/freckle-stats, @hackage/pdf-slave-server, Show all…
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