Jidoka.Handoff.OwnerStore behaviour (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Storage boundary for conversation handoff owners.

The default store is process-local ETS for examples and tests. Applications that need durable or clustered ownership can configure another module:

config :jidoka, :handoff_owner_store, MyApp.HandoffOwnerStore

Summary

Types

owner()

@type owner() :: %{
  agent: module(),
  agent_id: String.t(),
  handoff: Jidoka.Handoff.t(),
  updated_at_ms: integer()
}

Callbacks

owner(t)

@callback owner(String.t()) :: owner() | nil

put_owner(t, t)

@callback put_owner(String.t(), Jidoka.Handoff.t()) :: :ok

reset(t)

@callback reset(String.t()) :: :ok

Functions

owner(conversation_id)

@spec owner(String.t()) :: owner() | nil

put_owner(conversation_id, handoff)

@spec put_owner(String.t() | nil, Jidoka.Handoff.t()) :: :ok

reset(conversation_id)

@spec reset(String.t()) :: :ok

store()

@spec store() :: module()