extensible-effects-concurrent-0.21.1: Message passing concurrency as extensible-effect

Safe HaskellNone
LanguageHaskell2010

Control.Eff.Concurrent.Process.ForkIOScheduler

Description

Implement Erlang style message passing concurrency.

This module contains spawn which handles the Process effects, using TQueues and withAsync.

This aims to be a pragmatic implementation, so even logging is supported.

At the core is a main process that enters schedule and creates all of the internal state stored in TVars to manage processes with message queues.

Synopsis

Documentation

schedule :: HasCallStack => Eff InterruptableProcEff () -> Eff LoggingAndIo () Source #

This is the main entry point to running a message passing concurrency application. This function takes a Process on top of the SchedulerIO effect for concurrent logging.

defaultMain :: HasCallStack => Eff InterruptableProcEff () -> IO () Source #

Start the message passing concurrency system then execute a Process on top of SchedulerIO effect. All logging is sent to standard output.

defaultMainWithLogWriter :: HasCallStack => LogWriter IO -> Eff InterruptableProcEff () -> IO () Source #

Start the message passing concurrency system then execute a Process on top of SchedulerIO effect. All logging is sent to standard output.

type ProcEff = ConsProcess SchedulerIO Source #

The concrete list of Effects of processes compatible with this scheduler. This builds upon SchedulerIO.

type InterruptableProcEff = InterruptableProcess SchedulerIO Source #

The concrete list of the effects, that the Process uses

type SchedulerIO = Reader SchedulerState ': LoggingAndIo Source #

The concrete list of Effects for this scheduler implementation.

type HasSchedulerIO r = (HasCallStack, Lifted IO r, SchedulerIO <:: r) Source #

Type class constraint to indicate that an effect union contains the effects required by every process and the scheduler implementation itself.