extensible-effects-concurrent-0.32.0: 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 Effects () -> 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 BaseEffects effect for concurrent logging.

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

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

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

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

type SafeEffects = SafeProcesses BaseEffects Source #

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

Since: 0.25.0

type Effects = Processes BaseEffects Source #

The Effects for interruptable, concurrent processes, scheduled via forkIO.

Since: 0.25.0

type BaseEffects = Reader SchedulerState ': LoggingAndIo Source #

The concrete list of Effects for this scheduler implementation.

Since: 0.25.0

type HasBaseEffects r = (HasCallStack, Lifted IO r, BaseEffects <:: r) Source #

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

Since: 0.25.0