polysemy-conc-0.12.0.0: Polysemy effects for concurrency
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Conc.Effect.Events

Description

 
Synopsis

Documentation

data Events (e :: Type) :: Effect where Source #

An event publisher that can be consumed from multiple threads.

Constructors

Publish :: e -> Events e m () 

publish :: forall e r. Member (Events e) r => e -> Sem r () Source #

Publish one event.

data Consume (e :: Type) :: Effect where Source #

Consume events emitted by Events.

Constructors

Consume :: Consume e m e 

consume :: forall e r. Member (Consume e) r => Sem r e Source #

Consume one event emitted by Events.

subscribe :: forall e r. Member (Scoped_ (Consume e)) r => InterpreterFor (Consume e) r Source #

Create a new scope for Events, causing the nested program to get its own copy of the event stream. To be used with interpretEventsChan.