capataz-0.2.0.0: OTP-like supervision trees in Haskell

Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.Capataz.Internal.Worker

Description

This module contains all logic related to error handling when spawning threads to execute Worker sub-routines

Synopsis

Documentation

workerMain :: MonadUnliftIO m => ParentSupervisorEnv m -> WorkerOptions m -> WorkerId -> RestartCount -> m (Worker m) Source #

Decorates the given IO () sub-routine with failure handling

forkWorker :: MonadUnliftIO m => ParentSupervisorEnv m -> WorkerOptions m -> Maybe (WorkerId, RestartCount) -> m (Worker m) Source #

Internal function that forks a worker thread on the Capataz thread; note this is different from the public forkWorker function which sends a message to the capataz loop