WebhooksEmitter.Interface behaviour (webhooks_emitter v0.2.0) View Source

Specification for WebhooksEmitter

Link to this section Summary

Link to this section Types

Specs

emitter_config() :: WebhooksEmitter.Config.t()

Specs

emitter_id() :: term()

Specs

event_name() :: String.t() | atom()

Specs

event_names() :: [event_name(), ...]

Specs

event_payload() :: map()

Specs

request_id() :: String.t() | nil

Specs

url() :: String.t()

Link to this section Callbacks

Link to this callback

attach(emitter_id, event_name, emitter_config)

View Source

Specs

attach(emitter_id(), event_name(), emitter_config()) ::
  :ok | {:error, :already_exists | :already_present}
Link to this callback

attach_many(emitter_id, event_names, emitter_config)

View Source

Specs

attach_many(emitter_id(), event_names(), emitter_config()) ::
  :ok | {:error, :already_exists | :already_present}

Specs

detach(emitter_id()) :: :ok
Link to this callback

emit(event_name, event_payload, request_id)

View Source

Specs

emit(event_name(), event_payload(), request_id()) :: {:ok, request_id()}

Specs

list_emitters() :: [emitter_id()]

Specs

pause(emitter_id()) :: :ok

Specs

restart(emitter_id()) :: :ok | {:error, term()}

Specs

started?(emitter_id()) :: boolean()