BlogEngine.Notifier behaviour (blog_engine v0.1.0)

Copy Markdown View Source

Dispatches committed BlogEngine events to a host notifier.

Like the other host behaviours, a notifier receives the BlogEngine.Context that produced the event, so a host can route delivery by tenant, repo, or prefix without BlogEngine threading identity through the event payload.

Summary

Types

One committed BlogEngine event.

Callbacks

Receives one committed BlogEngine event with the context that produced it.

Functions

Invokes the notifier selected by the supplied context.

Types

event()

@type event() :: %{type: String.t(), data: map()}

One committed BlogEngine event.

Callbacks

notify(t, event)

@callback notify(BlogEngine.Context.t(), event()) :: :ok

Receives one committed BlogEngine event with the context that produced it.

Functions

notify(context, event)

@spec notify(BlogEngine.Context.t(), event()) :: :ok

Invokes the notifier selected by the supplied context.