Cairnloop.SLAPolicyProvider behaviour (cairnloop v0.1.0)

Copy Markdown View Source

Behaviour for providing SLA policies.

Host applications can implement this behaviour to provide custom SLA policy configurations dynamically, typically backed by a database.

Summary

Callbacks

Returns a list of active SLA policies.

Sets or creates a new SLA policy for a specific priority.

Callbacks

get_active_policies()

@callback get_active_policies() :: {:ok, [map()]} | {:error, term()}

Returns a list of active SLA policies.

set_policy(priority, attrs)

@callback set_policy(priority :: atom(), attrs :: map()) ::
  {:ok, map()} | {:error, term()}

Sets or creates a new SLA policy for a specific priority.