Documentation
¶
Index ¶
Constants ¶
const MemoWorkflowName = "TrajectoryIRMemoWorkflow"
MemoWorkflowName is the registered workflow type for step memo storage.
Variables ¶
This section is empty.
Functions ¶
func MemoWorkflow ¶
MemoWorkflow stores a step result as the workflow return value. Workflow id is MemoWorkflowID(workflowID, stepKey). Reusing the same id after completion is rejected so the first Save wins (Load returns that result).
func MemoWorkflowID ¶
MemoWorkflowID builds a stable Temporal workflow id for one durable step memo.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements durable.Backend using Temporal workflows as durable memos.
Each (workflowID, stepKey) maps to one Temporal workflow whose result is the JSON step payload. The first Save starts that workflow; later Saves are no-ops when the workflow already exists. Load returns the completed workflow result.
A worker registered via NewWorker must be running for Save to complete. This matches LocalSQLite semantics: Infer/Tool still execute fn in-process, then persist the result through the Backend. Moving fn into activities is a later hardening step.
func NewBackend ¶
NewBackend wraps an existing Temporal client.
type Config ¶
type Config struct {
HostPort string // e.g. localhost:7233
Namespace string // e.g. default
TaskQueue string // e.g. trajectory-ir
// TLS enables TLS on the Temporal frontend connection.
TLS bool
// APIKey is an optional Temporal Cloud API key (requires TLS).
APIKey string
}
Config holds Temporal client and worker settings. Env defaults match a local Temporal dev server (plaintext). For production, set TEMPORAL_TLS=true and optionally TEMPORAL_API_KEY.
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv reads TEMPORAL_HOSTPORT, TEMPORAL_NAMESPACE, TEMPORAL_TASK_QUEUE, TEMPORAL_TLS, and TEMPORAL_API_KEY.
func (Config) ClientOptions ¶
ClientOptions builds SDK client options from this config. Local defaults remain plaintext; production should enable TLS.