hydra-node-0.22.0: The Hydra node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Events

Description

This module defines the types and functions for creating EventSource and EventSink instances and is intended to be used as an extension point.

A single EventSource and zero or more EventSink handles are used by the main HydraNode handle to load and send out events.

See FileBased for an example implementation and FileBasedSpec for the corresponding test suite.

Custom implementations should be located under Hydra.Events to avoid conflicts.

Synopsis

Documentation

class HasEventId a where Source #

Methods

getEventId :: a -> EventId Source #

Instances

Instances details
HasEventId Word64 Source # 
Instance details

Defined in Hydra.Events

HasEventId (StateEvent tx) Source # 
Instance details

Defined in Hydra.HeadLogic.StateEvent

newtype EventSource e m Source #

Constructors

EventSource 

Fields

getEvents :: (HasEventId e, MonadUnliftIO m) => EventSource e m -> m [e] Source #

Retrieve all events from the event source as a list.

newtype EventSink e m Source #

Constructors

EventSink 

Fields

putEventsToSinks :: (Monad m, HasEventId e) => [EventSink e m] -> [e] -> m () Source #

Put a list of events to a list of event sinks in a round-robin fashion.