contract
ModuleWhat publishers and consumers promise, whatever the broker.
Contents
use utopia_queue::SystemClock;Rust
pub struct SystemClockThe system clock and random ids.
use utopia_queue::AsyncPublisher;Rust
pub trait AsyncPublisher: Send + SyncUndocumented.
Implemented byBackground
use utopia_queue::Clock;Rust
pub trait Clock: Send + SyncWhen things happen and how they are named: the clock and the ids a broker stamps on messages and deliveries. Replace it to make runs reproducible (tests pin both).
Implemented bySystemClock
use utopia_queue::Consumer;Rust
pub trait Consumer: Send + SyncUndocumented.
use utopia_queue::Publisher;Rust
pub trait Publisher: Send + SyncUndocumented.
use utopia_queue::payload;Rust
pub fn payload<T: serde::Serialize + ?Sized>(value: &T) -> Result<Array>Undocumented.
Rust
let payload = utopia_queue::payload(&serde_json::json!({"id": 7}))?;
assert_eq!(payload.get_str("id"), Some(&php_std::Value::Int(7)));