| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Eff.Concurrent.Process.SingleThreadedScheduler
Description
A coroutine based, single threaded scheduler for Processes.
- schedule :: forall r finalResult. Eff r () -> Eff (Process r ': r) finalResult -> Eff r (Either String finalResult)
- schedulePure :: Eff (ConsProcess '[]) a -> Either String a
- scheduleIO :: SetMember Lift (Lift IO) r => Eff (ConsProcess r) a -> Eff r (Either String a)
- scheduleWithLogging :: Eff (ConsProcess '[Logs m]) a -> (Either String a, Seq m)
- defaultMain :: HasCallStack => Eff '[Process '[Logs String, Lift IO], Logs String, Lift IO] () -> IO ()
- singleThreadedIoScheduler :: SchedulerProxy LoggingAndIo
- type LoggingAndIo = '[Logs String, Lift IO]
Documentation
Arguments
| :: Eff r () | An that performs a yield w.r.t. the underlying effect
|
| -> Eff (Process r ': r) finalResult | |
| -> Eff r (Either String finalResult) |
Execute a Process and all the other processes spawned by it in the
current thread concurrently, using a co-routine based, round-robin
scheduler. If a process exits with exitNormally, exitWithError,
raiseError or is killed by another process Left ... is returned.
Otherwise, the result will be wrapped in a Right.
schedulePure :: Eff (ConsProcess '[]) a -> Either String a Source #
scheduleIO :: SetMember Lift (Lift IO) r => Eff (ConsProcess r) a -> Eff r (Either String a) Source #
scheduleWithLogging :: Eff (ConsProcess '[Logs m]) a -> (Either String a, Seq m) Source #
Like schedulePure but with logging.
scheduleWithLogging ==
@since 0.3.0.2run . captureLogs . schedule (return ())