Threadline.ExportQueue behaviour (Threadline v0.6.0)

Copy Markdown View Source

Behaviour for enqueueing asynchronous export jobs.

Threadline provides a simple OTP Task.Supervisor-based implementation by default. Adopters needing persistent or multi-node queueing can implement this behaviour using tools like Oban.

The init/1 callback is used for dependency safeguards, ensuring adapters fail early if their required underlying library is missing from the environment.

Summary

Callbacks

Enqueues an export job for background processing.

Initializes the adapter. Called during application startup to verify configuration and presence of underlying dependencies.

Types

job_id()

@type job_id() :: String.t() | binary()

Callbacks

enqueue(job_id)

@callback enqueue(job_id()) :: :ok | {:error, term()}

Enqueues an export job for background processing.

Takes the ID of the threadline_export_jobs record to process.

init(keyword)

@callback init(keyword()) :: :ok | {:error, term()}

Initializes the adapter. Called during application startup to verify configuration and presence of underlying dependencies.