Skip to main content

WriteQueue

Trait WriteQueue 

Source
pub trait WriteQueue: Send + Sync {
    // Required method
    fn enqueue<'a>(
        &'a self,
        write: QueuedWrite,
    ) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'a>>;

    // Provided method
    fn enabled(&self) -> bool { ... }
}
Expand description

A queue that durably accepts resolved write ops for downstream fan-out.

The implementor (a Kafka producer with a write-ahead log, in the shipped binary) must only resolve the future Ok once the op is durably accepted, so the 202 the pipeline returns is truthful. Implementations MUST NOT panic.

Required Methods§

Source

fn enqueue<'a>( &'a self, write: QueuedWrite, ) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'a>>

Durably enqueues write, resolving Ok only once it is accepted.

Provided Methods§

Source

fn enabled(&self) -> bool

Whether async writes can be served. false (the default NoQueue) means an async request is refused rather than dropped.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§