Jido.Composer.Resume (Jido Composer v0.4.0)

Copy Markdown View Source

External-facing API for resuming suspended agents.

Handles both live agents (deliver signal directly) and checkpointed agents (thaw from storage, then deliver). Provides idempotency via suspension ID matching.

Options

  • :deliver_fn(agent, signal) -> {agent, directives}. Required. Delivers the resume signal to a live agent.
  • :thaw_fn(agent_id) -> {:ok, agent} | {:error, reason}. Optional. Restores an agent from checkpoint storage.

  • :agent_idString.t(). Required when agent is nil and :thaw_fn is provided.
  • :storage — Map with compare_and_set_status/3 callback. Optional. When provided, performs CAS on checkpoint status for idempotent resume.

Summary

Functions

resume(agent, suspension_id, resume_data, opts \\ [])

@spec resume(Jido.Agent.t() | nil, String.t(), map(), keyword()) ::
  {:ok, Jido.Agent.t(), list()} | {:error, term()}