Rust

One Redis server.

Contents

use utopia_queue::connection::redis::Redis;
Rust
pub struct Redis

A connection to one Redis server, opened on first use and reopened after the socket is lost.

Connecting is retried five times with jittered exponential backoff. A command that fails because the socket went away drops the connection; a command safe to repeat (reads, SET, DEL, LREM) is run once more on a fresh one, others (pops, pushes, counters) report the error, because the server may already have applied them.

Rust
use utopia_queue::connection::{Connection, Redis};

let redis = Redis::new("localhost", 6379);
redis.left_push(b"jobs", b"payload").await?;
assert_eq!(redis.list_size(b"jobs").await?, 1);
Compiles in CI; needs a running service to execute.