bunqueue-client (Rust)
Official synchronous Rust SDK for the bunqueue TCP protocol.
Install
Until the crate is published, use a checkout as a path dependency:
[]
= { = "../bunqueue/sdk/rust" }
Quick start
use ;
Workers use a bounded thread pool. Return ProcessError::retryable(...) for
a normal failure or ProcessError::unrecoverable(...) to skip retries.
Surface
- producer, bulk add, complete job option mapping;
- query, control, DLQ, schedulers, rate-limit duration/TTL, and ping;
- bounded threaded workers with ACK/FAIL and reconnect registration;
- parent/child flows and chains;
- auth-first handshake and verified TLS with system or custom CAs;
- recursive int64 guard, outgoing map/extension validation, ext-0 tolerance, and a 64 MiB frame cap;
- opt-in structured telemetry for connections, commands, authentication, deadlines, reconnects, errors, and worker retries.
Telemetry
use Arc;
use ;
let telemetry: TelemetryCallback = new;
let queue = new;
Callbacks run after the connection mutex is released, so they may safely call
other SDK objects. A callback panic is isolated and never changes queue
behavior. Authentication tokens are redacted from ConnectionOptions debug
output.
Quality
BUNQUEUE_SDK_SOAK_SECONDS=3600
The native tests cover wire validation, frame limits, option mapping, error
shapes, telemetry, auth, timeout/reconnect, TLS verification, worker
registration, concurrency-safe batch pulls, and flow rollback. The conformance
command must finish with 17/17 and VERDICT: CONFORMANT. Native integration
tests require bun and openssl on PATH.
Hardening includes 24-way idempotent retries, 12-way single-lease contention,
generated MessagePack payloads, malformed extensions, a 512-job spike, and a
durable job surviving broker SIGKILL/restart. The ignored soak test reuses one
connection; BUNQUEUE_SDK_SOAK_BATCH controls its diagnostic stress level.