Crate background_jobs_core

Crate background_jobs_core 

Source
Expand description

§Background Jobs Core

basic types and traits for implementing a background jobs processor

This crate shouldn’t be depended on directly, except in the case of implementing a custom jobs processor. For a default solution based on Actix and Sled, look at the background-jobs crate.

Modules§

memory_storage
A default, in-memory implementation of a storage mechanism

Structs§

BoxError
A simple error box that provides no additional formatting utilities
CachedProcessorMap
A type for storing the relationships between job names and the job itself, with the state pre-cached instead of being generated from the state function each time
JobInfo
Metadata pertaining to a job that exists within the background_jobs system
JoinError
The type produced when a task is dropped before completion as a result of being deliberately canceled, or it panicking
NewJobInfo
Information about a newly created job
ProcessorMap
A type for storing the relationships between job names and the job itself
ReturnJobInfo
Information about the sate of an attempted job

Enums§

Backoff
Different styles for retrying jobs
JobError
The error type returned by the process method
JobResult
Indicate the state of a job after an attempted run
MaxRetries
How many times a job should be retried before giving up
ShouldStop
A type that represents whether a job should be requeued

Traits§

Job
The Job trait defines parameters pertaining to an instance of background job
Storage
Define a storage backend for jobs
UnsendJob
The UnsendJob trait defines parameters pertaining to an instance of a background job
UnsendSpawner
The mechanism used to spawn Unsend futures, making them Send

Functions§

new_job
A provided method to create a new JobInfo from provided arguments
new_scheduled_job
Create a NewJobInfo to schedule a job to be performed after a certain time
process
A provided method to coerce arguments into the expected type and run the job