ExWapp.Events behaviour (ExWapp v0.1.2)

Copy Markdown View Source

Behaviour for delivering high-level ExWapp events.

This deliberately does not prescribe PubSub, process messages, or OTP. Host applications choose how subscriptions work by implementing this behaviour.

Summary

Functions

Emits one event through the client's configured event adapter.

Emits events in order and stops on the first adapter error.

Callbacks

emit(t, t)

@callback emit(ExWapp.Client.t(), ExWapp.Event.t()) :: :ok | {:error, term()}

Functions

emit(client, event)

@spec emit(ExWapp.Client.t(), ExWapp.Event.t()) :: :ok | {:error, term()}

Emits one event through the client's configured event adapter.

emit_many(client, events)

@spec emit_many(ExWapp.Client.t(), [ExWapp.Event.t()]) :: :ok | {:error, term()}

Emits events in order and stops on the first adapter error.