distributed-process-execution-0.1.5.0: Execution Framework for The Cloud Haskell Application Platform
Copyright(c) Well-Typed / Tim Watson
LicenseBSD3 (see the file LICENSE)
MaintainerTim Watson <[email protected]>
Stabilityexperimental
Portabilitynon-portable (requires concurrency)
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Process.Execution.EventManager

Description

Overview

The EventManager is a parallel/concurrent event handling tool, built on top of the Exchange API. Arbitrary events are published to the event manager using notify, and are broadcast simulataneously to a set of registered event handlers.

Defining and Registering Event Handlers

Event handlers are defined as Serializable m => s -> m -> Process s, i.e., an expression taking an initial state, an arbitrary Serializable event/message and performing an action in the Process monad that evaluates to a new state.

See Control.Distributed.Process.Execution.Exchange.

Synopsis

Documentation

data EventManager Source #

Opaque handle to an Event Manager.

Instances

Instances details
Binary EventManager Source # 
Instance details

Defined in Control.Distributed.Process.Execution.EventManager

Resolvable EventManager Source # 
Instance details

Defined in Control.Distributed.Process.Execution.EventManager

Generic EventManager Source # 
Instance details

Defined in Control.Distributed.Process.Execution.EventManager

Associated Types

type Rep EventManager 
Instance details

Defined in Control.Distributed.Process.Execution.EventManager

type Rep EventManager = D1 ('MetaData "EventManager" "Control.Distributed.Process.Execution.EventManager" "distributed-process-execution-0.1.5.0-9ft8kt71jqJFQLQ1PfEqJf" 'True) (C1 ('MetaCons "EventManager" 'PrefixI 'True) (S1 ('MetaSel ('Just "ex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exchange)))
type Rep EventManager Source # 
Instance details

Defined in Control.Distributed.Process.Execution.EventManager

type Rep EventManager = D1 ('MetaData "EventManager" "Control.Distributed.Process.Execution.EventManager" "distributed-process-execution-0.1.5.0-9ft8kt71jqJFQLQ1PfEqJf" 'True) (C1 ('MetaCons "EventManager" 'PrefixI 'True) (S1 ('MetaSel ('Just "ex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exchange)))

start :: Process EventManager Source #

Start a new Event Manager process and return an opaque handle to it.

notify :: Serializable a => EventManager -> a -> Process () Source #

Broadcast an event to all registered handlers.

addHandler :: forall s a. Serializable a => EventManager -> (s -> a -> Process s) -> Process s -> Process ProcessId Source #

Add a new event handler. The handler runs in its own process, which is spawned locally on behalf of the caller.

addMessageHandler :: EventManager -> (s -> Message -> Process (Maybe s)) -> Process s -> Process ProcessId Source #

As addHandler, but operates over a raw Control.Distributed.Process.Message.