biegunka-0.2: DSL definitions, interpreters, templating, git support

Safe HaskellNone

Control.Biegunka.Execute.Watcher

Contents

Description

Execution Watcher

Synopsis

Watcher

data Watcher Source

Watcher abstract data type

Watcher watches number of jobs currently running and subtasks ids that are already done execution

new :: IO WatcherSource

Create new Watcher

Newly created Watcher does not know about any jobs and tasks

wait :: Watcher -> IO ()Source

Create new Watcher

Waits until job counter reaches 0

 new >>= wait ≡ return ()

register :: MonadIO m => Watcher -> m ()Source

Watcher jobs counter goes up

unregister :: MonadIO m => Watcher -> m ()Source

Watcher jobs counter goes down

done :: MonadIO m => Watcher -> Token -> m ()Source

notify Watcher subtask is done

waitDone :: MonadIO m => Watcher -> Set Token -> m ()Source

Wait until all those subtasks are done