Backend boundary for Temporal client and worker transport.
Backends own client resources, worker resources, and protocol translation.
They deliver decoded core structs to Temporalex.Server, accept core
completions from it, and execute public client operations for
Temporalex.Client. Backend-specific transport, protobuf, native resources,
and worker handles must stay behind this behaviour.
Summary
Callbacks
Fetches a workflow's history as an opaque binary.
Types
Callbacks
@callback cancel_workflow( client_state(), workflow_id :: binary(), run_id :: binary() | nil, opts :: keyword() ) :: :ok | {:error, term()}
@callback complete_activity_task( worker_state(), Temporalex.Core.ActivityCompletion.t() ) :: :ok | {:error, term()}
@callback complete_workflow_activation( worker_state(), Temporalex.Core.Completion.t() ) :: :ok | {:error, term()}
@callback fetch_workflow_history( client_state(), workflow_id :: binary(), run_id :: binary() | nil, opts :: keyword() ) :: {:ok, binary()} | {:error, term()}
Fetches a workflow's history as an opaque binary.
The binary is encoded protobuf, but callers must treat it as opaque: feed it to a replay worker or persist it as a replay fixture. It is deliberately not decoded into core structs — the only consumer is the replayer, which wants the encoded form, so decoding and re-encoding would be waste. Backend transport detail stays out of executor and workflow semantics either way.
@callback record_activity_heartbeat( worker_state(), task_token :: binary(), details :: term() ) :: :ok | {:error, term()}
@callback shutdown_client(client_state()) :: :ok | {:error, term()}
@callback shutdown_worker(worker_state()) :: :ok | {:error, term()}
@callback start_client(opts :: keyword(), owner_pid :: pid()) :: {:ok, client_state()} | {:error, term()}
@callback start_worker(client_state(), opts :: keyword(), owner_pid :: pid()) :: {:ok, worker_state()} | {:error, term()}
@callback terminate_workflow( client_state(), workflow_id :: binary(), run_id :: binary() | nil, opts :: keyword() ) :: :ok | {:error, term()}