# `Membrane.EventProtocol`
[🔗](https://github.com/membraneframework/membrane-core/blob/v1.2.6/lib/membrane/event_protocol.ex#L1)

Protocol that allows to configure behaviour of `Membrane.Event`s.

Each event has to implement or derive this protocol.

# `t`

```elixir
@type t() :: struct()
```

A type describing all the types that implement the `Membrane.EventProtocol` protocol.

# `async?`

```elixir
@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.

# `sticky?`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
