PushEx.Behaviour.PushInstrumentation behaviour (PushEx v2.2.0)

Implementable hook points for push lifecycle instrumentation. Callbacks are required but do not need to do anything.

Summary

Callbacks

Called immediately before an API response is delivered.

Called when an API request is started.

Called when a push is delivered to a Channel. This can occur more, less, or the same number of times as a push being requested.

Called when a push is requested to be sent. By default this happens in the API controller.

Callbacks

api_processed(%PushEx.Instrumentation.Push.Context{})

@callback api_processed(%PushEx.Instrumentation.Push.Context{unix_ms_occurred_at: term()}) ::
  any()

Called immediately before an API response is delivered.

api_requested(%PushEx.Instrumentation.Push.Context{})

@callback api_requested(%PushEx.Instrumentation.Push.Context{unix_ms_occurred_at: term()}) ::
  any()

Called when an API request is started.

delivered(%PushEx.Push{}, %PushEx.Instrumentation.Push.Context{})

@callback delivered(
  %PushEx.Push{channel: term(), data: term(), event: term(), unix_ms: term()},
  %PushEx.Instrumentation.Push.Context{unix_ms_occurred_at: term()}
) :: any()

Called when a push is delivered to a Channel. This can occur more, less, or the same number of times as a push being requested.

requested(%PushEx.Push{}, %PushEx.Instrumentation.Push.Context{})

@callback requested(
  %PushEx.Push{channel: term(), data: term(), event: term(), unix_ms: term()},
  %PushEx.Instrumentation.Push.Context{unix_ms_occurred_at: term()}
) :: any()

Called when a push is requested to be sent. By default this happens in the API controller.