RigInboundGatewayWeb.EventBuffer (Reactive Interaction Gateway v3.0.0-alpha.2) View Source
A circular buffer for events.
Buffers events up to a configurable capacity. After that, every new item overwrites the oldest one.
Link to this section Summary
Functions
Add an event to this buffer.
All events, sorted from oldest to newest event.
The capacity is the maximum number of events this buffer can hold.
Creates a new EventBuffer with the given capacity.
Link to this section Types
Specs
t() :: %RigInboundGatewayWeb.EventBuffer{ capacity: pos_integer(), events: [RigCloudEvents.CloudEvent.t()] }
A circular event buffer.
Link to this section Functions
Specs
add_event(t(), RigCloudEvents.CloudEvent.t()) :: t()
Add an event to this buffer.
If the buffer runs at full capacity, this overwrites the oldest event in the buffer.
Specs
all_events(t()) :: [RigCloudEvents.CloudEvent.t()]
All events, sorted from oldest to newest event.
Specs
capacity(t()) :: pos_integer()
The capacity is the maximum number of events this buffer can hold.
Specs
Specs
new(pos_integer()) :: t()
Creates a new EventBuffer with the given capacity.