Membrane.EventProtocol protocol (Membrane Core v0.8.1) View Source

Protocol that allows to configure behaviour of Membrane.Events.

Each event has to implement or derive this protocol.

Link to this section Summary

Functions

Determines whether event is synchronized with buffers (sync) or not (async). Defaults to false (sync).

Specifies whether event is sent right away (not sticky), or it is 'pushed' by the next sent buffer (sticky). Defaults to false (not sticky).

Link to this section Types

Link to this section Functions

Specs

async?(t()) :: boolean()

Determines whether event is synchronized with buffers (sync) or not (async). Defaults to false (sync).

Buffers and sync events are always received in the same order they are sent. Async events are handled before any enqueued buffers that are waiting to be processed (e.g. in Membrane.InputBuffer).

Specs

sticky?(t()) :: boolean()

Specifies whether event is sent right away (not sticky), or it is 'pushed' by the next sent buffer (sticky). Defaults to false (not sticky).

Returning a sticky event from a callback stores it in a queue. When the next buffer is to be sent, all events from the queue are sent before it. An example can be the Membrane.Event.StartOfStream event.