Codex.Approvals.Registry (Codex SDK v0.16.1)

Copy Markdown View Source

ETS-based registry for tracking async approval requests.

This module maintains state for pending approval requests that are awaiting decisions from external systems (e.g., Slack, Jira, custom webhooks).

Summary

Functions

Returns a specification to start this module under a supervisor.

Cleans up expired approval requests.

Deletes an approval request from the registry.

Looks up an approval request by reference.

Registers a new async approval request.

Starts the approval registry.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

cleanup_expired(max_age_ms)

@spec cleanup_expired(pos_integer()) :: non_neg_integer()

Cleans up expired approval requests.

delete(ref)

@spec delete(reference()) :: :ok

Deletes an approval request from the registry.

lookup(ref)

@spec lookup(reference()) :: {:ok, map()} | {:error, :not_found}

Looks up an approval request by reference.

register(ref, metadata)

@spec register(reference(), map()) :: :ok

Registers a new async approval request.

start_link(opts \\ [])

Starts the approval registry.