pub struct SinkRuntime {
pub queues: ShardQueues,
pub drain: Box<dyn FnOnce(Duration) -> Pin<Box<dyn Future<Output = DrainReport> + Send>> + Send>,
pub probe: Option<Box<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), SinkError>> + Send>> + Sync + Send>>,
}Expand description
The sink half the runtime drives: the shared shard-queue handle plus a drain hook invoked once at shutdown with the remaining drain budget.
Built by the sink layer (SinkPool) or by tests; the runtime is
deliberately ignorant of worker internals.
Fields§
§queues: ShardQueuesSending side of the per-shard chunk queues (the runtime only uses capacity introspection; the chain’s terminal stage holds clones).
drain: Box<dyn FnOnce(Duration) -> Pin<Box<dyn Future<Output = DrainReport> + Send>> + Send>Drain the sink: flush what’s pending within the budget, fail the acknowledgements of anything abandoned, and report.
probe: Option<Box<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), SinkError>> + Send>> + Sync + Send>>Optional connectivity probe (e.g. SinkPool::probe_all). The
runtime probes at startup and then periodically, driving the
sinks-connected half of /readyz. Without a probe the flag is set
unconditionally.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SinkRuntime
impl !RefUnwindSafe for SinkRuntime
impl Send for SinkRuntime
impl !Sync for SinkRuntime
impl Unpin for SinkRuntime
impl UnsafeUnpin for SinkRuntime
impl !UnwindSafe for SinkRuntime
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more