View Source FaktoryWorker.Sandbox (faktory_worker v1.9.0)

When started with sandbox mode enabled, FaktoryWorker won't connect to a running Faktory instance or perform queued jobs, but will instead record all jobs enqueued locally.

In general, this mode should only be used during testing. See Sandbox Testing to read more.

Link to this section Summary

Types

A concise description of a single call to a job module.

Functions

Returns true if sandbox mode is enabled.

Returns a list of all locally enqueued jobs across all job modules, in the order that they were enqueued. If you only want to retrieve jobs enqueued for a specific job module, use all_jobs/1 instead.

Returns a list of all locally enqueued jobs for the given job module, in the order that they were enqueued. If you want to retrieve a list of all jobs across all job modules, use all_jobs/0 instead.

Returns a specification to start this module under a supervisor.

Clear the queue history for all job modules.

Clear the queue history for the given job module.

Link to this section Types

@type job() :: %{worker: module(), args: list(), opts: Keyword.t()}

A concise description of a single call to a job module.

Link to this section Functions

@spec active?() :: boolean()

Returns true if sandbox mode is enabled.

@spec all_jobs() :: [job()]

Returns a list of all locally enqueued jobs across all job modules, in the order that they were enqueued. If you only want to retrieve jobs enqueued for a specific job module, use all_jobs/1 instead.

@spec all_jobs(module()) :: [job()]

Returns a list of all locally enqueued jobs for the given job module, in the order that they were enqueued. If you want to retrieve a list of all jobs across all job modules, use all_jobs/0 instead.

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec reset() :: :ok

Clear the queue history for all job modules.

@spec reset(module()) :: :ok

Clear the queue history for the given job module.