Idiomatic API for working with Chronicle jobs.
Jobs represent long-running Chronicle operations such as replays and rebuilds. This module lets you inspect current jobs, inspect their steps, and control their lifecycle.
Usage
{:ok, jobs} = Chronicle.Jobs.all()
{:ok, job} = Chronicle.Jobs.get("8a6f5a0c-0fbf-42bd-8db0-a60f9a449b11")
:ok = Chronicle.Jobs.stop("8a6f5a0c-0fbf-42bd-8db0-a60f9a449b11")Options
:client— the client name (default:Chronicle.Client):namespace— overrides the client's default namespace
Summary
Types
@type job_id() :: String.t()
Functions
@spec all(keyword()) :: {:ok, [Chronicle.Jobs.Job.t()]} | {:error, term()}
Gets all jobs for the configured event store namespace.
Deletes a job.
@spec get( job_id(), keyword() ) :: {:ok, Chronicle.Jobs.Job.t() | nil} | {:error, term()}
Gets a single job by identifier.
Returns {:ok, nil} when the job does not exist.
@spec get_job( job_id(), keyword() ) :: {:ok, Chronicle.Jobs.Job.t() | nil} | {:error, term()}
Compatibility alias for get/2.
@spec get_job_steps( job_id(), keyword() ) :: {:ok, [Chronicle.Jobs.JobStep.t()]} | {:error, term()}
Compatibility alias for steps/2.
@spec get_jobs(keyword()) :: {:ok, [Chronicle.Jobs.Job.t()]} | {:error, term()}
Compatibility alias for all/1.
Resumes a stopped job.
@spec steps( job_id(), keyword() ) :: {:ok, [Chronicle.Jobs.JobStep.t()]} | {:error, term()}
Gets all steps for a specific job.
Stops a job.