Crate coil

Source
Expand description

coil is a efficient background job queue for Postgres. The API is very similiar and indeed based upon swirl. In addition to the functionality swirl offers, however, coil can:

  • Queue asynchronous tasks for execution on an executor, whether it be smol, tokio or async-std
  • Queue functions with generics
  • SQL queries in coil are ran asynchronously wherever possible
  • Migrations are stored in the binary, and accessible via a migrate() fn. No more needing to copy-paste migration files!

Macros§

register_job
Register a job to be run by coil. This must be called for any implementors of [coil::Job]

Structs§

Builder
Builder pattern struct for the Runner
Runner
Runner for background tasks. Synchronous tasks are run in a threadpool.

Enums§

BatchInsertError
EnqueueError
Error
FetchError

Traits§

Job
Background job
JobExt

Functions§

migrate
Run the migrations for the background tasks. This creates a table _background_tasks which stores the tasks for execution

Type Aliases§

PerformError
Catch-all error for jobs

Attribute Macros§

background_job
The attribute macro for creating background jobs.