HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleasync-timer-0.2.0.0Haskell2010

Control.Concurrent.Async.Timer

This module exports the public API for asynchronous timers.

  • 2 types
  • 6 values
datadata Timer
#

This is the type of timer handle, which will be provided to the IO action to be executed within withAsyncTimer. The user can use timerWait on this timer to delay execution until the next timer synchronization event.

datadata TimerConf
#

Type of a timer configuration.

valuedefaultConf :: TimerConf
#

Default timer configuration specifies no initial delay and an interval delay of 1s.

valuewithAsyncTimer
  1. :: (MonadUnliftIO m, MonadMask m)
  2. => TimerConf
  3. -> Timer -> m b
  4. -> m b
#

Spawn a timer thread based on the provided timer configuration and then run the provided IO action, which receives the new timer as an argument and call timerWait on it for synchronization. When the provided IO action has terminated, the timer thread will be terminated also.