pub trait ZerobusTransport: Send + Sync {
// Required methods
fn submit<'life0, 'async_trait>(
&'life0 self,
ipc: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Offset, ZerobusSinkError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_for_offset<'life0, 'async_trait>(
&'life0 self,
offset: Offset,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
One long-lived Zerobus stream.
Required Methods§
Sourcefn submit<'life0, 'async_trait>(
&'life0 self,
ipc: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Offset, ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit<'life0, 'async_trait>(
&'life0 self,
ipc: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Offset, ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit an Arrow-IPC-encoded batch fire-and-forget; return the assigned offset as soon as the transport accepts it (does not wait for a durable ack).
§Errors
ZerobusSinkError (transient or poison) if the transport rejects the
submission.
Sourcefn wait_for_offset<'life0, 'async_trait>(
&'life0 self,
offset: Offset,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_for_offset<'life0, 'async_trait>(
&'life0 self,
offset: Offset,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Wait for the server’s durable (WAL) acknowledgement of offset. Because
acks are highest-offset and monotonic, this single call confirms every
record at or below offset.
§Errors
ZerobusSinkError::Transient for a retryable slow-ack / network blip,
ZerobusSinkError::Poison for an unrecoverable stream error.
Sourcefn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ZerobusSinkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drain: await acknowledgement of every queued record (shutdown / checkpoint).
§Errors
ZerobusSinkError if the drain fails.