The official Rust client for sepp,
a small, language-agnostic durable job queue.
- Producers — enqueue jobs one at a time, in best-effort batches, or atomically. Supports idempotency keys, priorities, scheduled delivery and custom metadata.
- Consumers — a high-level
Workerruns the whole reserve → process → ack loop for you with bounded concurrency, automatic lease extension and graceful shutdown, or drop down to the rawreserve/ack/nack/extendcalls for full control. - Observability — with the default
opentelemetryfeature, the client emitstracingspans and metrics and propagates W3C trace context from the producer's enqueue span to the worker's process span. The host application owns the exporter. - Typed errors — deterministic server rejections (payload too large, unknown queue, …) are separate from transient transport errors, so retry logic stays simple.
The client is async-only and requires a tokio runtime.
cargo add sepp-rsEnqueue a job, then run a worker that processes it (requires a running sepp server):
use std::time::Duration;
use sepp_rs::client::SeppClient;
use sepp_rs::worker::Worker;
use sepp_rs::{EnqueueRequest, Payload};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = SeppClient::connect("http://127.0.0.1:50051").await?;
// Producer: enqueue a job onto the `emails` queue.
let ack = client
.enqueue(
EnqueueRequest::new("emails", "send_welcome")?
.with_payload(Payload::new(b"{\"user\":42}".to_vec(), "application/json")),
)
.await?;
println!("enqueued job {}", ack.job_id);
// Consumer: process `send_welcome` jobs from the `emails` queue. A handler
// returns `Ok(())` to ack the job, or a `HandlerError` to nack it.
Worker::new(client, ["emails"], Duration::from_secs(30))?
.handle("send_welcome", |payload, ctx| async move {
println!("processing job {}", ctx.id);
Ok(())
})?
.run()
.await;
Ok(())
}Runnable versions live in examples/, including traced.rs which wires up an OTLP exporter for end-to-end distributed tracing.
opentelemetry(default) — OpenTelemetry-compatible tracing spans, metrics and automatic trace context propagation.tls— TLS for the gRPC transport.
The full API reference is on docs.rs. For running and configuring the sepp server itself, see the sepp docs site.
sepp-rs is licensed under the MIT License. See LICENSE for details.