Crate apalis_core
source ·Expand description
apalis-core
Utilities for building job and message processing tools. This crate contains traits for working with workers.
async fn run() {
Monitor::new()
.register_with_count(2, move |c| {
WorkerBuilder::new(format!("tasty-banana-{c}"))
.layer(TraceLayer::new())
.with_storage(sqlite.clone())
.build_fn(send_email)
})
.shutdown_timeout(Duration::from_secs(1))
/// Here you could use tokio::ctrl_c etc
.run_with_signal(async { Ok(()) }).await
}
Modules
- Represent utilities for creating worker instances.
- Represents the [
JobContext
]. - Includes all possible error types.
- Represents an executor. Currently tokio is implemented as default
- expose
expose
Utilities to expose workers and jobs to external tools eg web frameworks and cli tools - Includes the utilities for a job.
- Represents a service that is created from a function.
- Represents middleware offered through [
tower::Layer
] - apalis mocking utilities
- Represents monitoring of running workers
- mq
mq
Message queuing utilities - Represents the job bytes.
- Represents different possible responses.
- storage
storage
Represents ability to persist and consume jobs from storages. - Represents extra utils needed for runtime agnostic approach
- Represents the utils for building workers.