View Source Surrealix.Dispatch (surrealix v0.1.3)
Handles callback registration (for only when using live queries). Based on ideas here: https://github.com/keathley/sync_dispatch
- which itself is based on :telemetry (https://hex.pm/packages/telemetry) implementation.
Summary
Functions
Attaches a function to an event. The provided id is used for idempotence. Different handlers should use unique handler ids.
Executes an event and any handlers that are attached to the event name. data
can be any term().
Types
Functions
@spec attach(term(), [atom()], handler_function(), term()) :: :ok | {:error, %Surrealix.AttachError{__exception__: true, message: term()}}
Attaches a function to an event. The provided id is used for idempotence. Different handlers should use unique handler ids.
Executes an event and any handlers that are attached to the event name. data
can be any term().