| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Polysemy.Conc.Effect.Events
Description
Synopsis
- newtype EventToken token = EventToken {
- unEventToken :: token
- data Events (token :: Type) (e :: Type) :: Effect where
- publish :: forall e token r. Member (Events token e) r => e -> Sem r ()
- data Consume (e :: Type) :: Effect where
- consume :: forall e r. Member (Consume e) r => Sem r e
- subscribe :: forall e token r. Member (Scoped (EventToken token) (Consume e)) r => InterpreterFor (Consume e) r
Documentation
newtype EventToken token Source #
Constructors
| EventToken | |
Fields
| |
Instances
data Events (token :: Type) (e :: Type) :: Effect where Source #
An event publisher that can be consumed from multiple threads.
Instances
| type DefiningModule Events Source # | |
Defined in Polysemy.Conc.Effect.Events | |
data Consume (e :: Type) :: Effect where Source #
Consume events emitted by Events.
Instances
| type DefiningModule Consume Source # | |
Defined in Polysemy.Conc.Effect.Events | |
subscribe :: forall e token r. Member (Scoped (EventToken token) (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.