SQL query interface for pgflow worker operations.
Provides functions for registering workers and managing their lifecycle.
Summary
Functions
@spec mark_worker_stopped(Ecto.Repo.t(), String.t()) :: {:ok, nil} | {:error, term()}
Marks a worker as stopped.
Sets the stopped_at timestamp for graceful shutdown signaling.
Parameters
repo- The Ecto repositoryworker_id- The worker identifier (UUID string)
Returns
{:ok, nil}- Success{:error, reason}- Error details if the operation fails
@spec register_worker(Ecto.Repo.t(), String.t(), String.t(), String.t()) :: {:ok, nil} | {:error, term()}
Registers a worker in the database.
Creates a new worker record or updates the heartbeat if the worker already exists.
Parameters
repo- The Ecto repositoryworker_id- The worker identifier (UUID string)queue_name- The queue name (flow_slug)function_name- The function name (e.g., "elixir:MyApp.Flows.MyFlow")
Returns
{:ok, nil}- Success{:error, reason}- Error details if the operation fails