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

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

@spec 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 buffers enqueued that are waiting in Membrane internal queues to be processed.

@spec 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.