uf-boson 0.1.0

Public Boson facade — async work engine
Documentation

boson (uf-boson on crates.io)

Main crate — re-exports core types, runtime, optional backends, and the #[task] macro.

The crates.io package is uf-boson (boson is already taken). With [lib] name = "boson", imports stay use boson::….

Source of truth: cargo doc -p uf-boson --features mem,axum --open — see the documentation map on the crate root for task-oriented entry points. Published docs: https://docs.rs/uf-boson

Role

Cargo features

Feature Enables
mem MemQueueBackend and bootstrap helpers
sqlite SqliteQueueBackend and bootstrap helpers
postgres PostgresQueueBackend and bootstrap helpers
telemetry-console ConsoleOpsLog (always available via re-export)
axum HTTP admin router and state types

This crate ships with no default features (default = []).

Boot a worker

[dependencies]
boson = { package = "uf-boson", version = "0.1.0", features = ["mem"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
use std::sync::Arc;

use boson::{configure, task, Boson, ExecutionContext, JsonExecutionContextFactory, MemQueueBackend};

#[task(name = "my_task")]
async fn my_task(ctx: Box<dyn ExecutionContext>) -> boson_core::Result<()> {
    let _ = ctx;
    Ok(())
}

let boson = Boson::builder()
    .queue_backend(Arc::new(MemQueueBackend::new()))
    .execution_context_factory(JsonExecutionContextFactory)
    .auto_registry()
    .build()?;
configure(boson);

With HTTP admin: features = ["mem", "axum"]. Full walkthrough: task_macro example.

Define handlers and enqueue

After boot, add handlers with #[task] and enqueue with <TaskName>::send_with(...). See boson-macros for policy attributes.

Configuration precedence

Layer Resolution order
Worker settings BosonBuilder field → env var → default
Task config at enqueue Persisted backend config → macro/descriptor defaults
Idempotency mode Per-task override → runtime builder default
Queue backend Explicit queue_backend() → global router
Ops log Builder ops_log()NoOpsLog; or ops_log_from_env()
Fleet URLs (Redis/NATS) BOSON_*_POOL_ROUTINGBOSON_*_URLS

Related crates