pub struct OpenSlot {
shards: Arc<[Shard]>,
}Expand description
Every shard of one signal’s open blocks, asked together.
The interesting half is OpenSlot::fresh, and what makes it fresh
rather than merely recent is the order the queues already enforce. submit
acknowledges an export only after the job is in some shard’s channel, so
every acknowledged export is queued before a request issued after it — and
if each shard answers only once its own channel is empty, the answers
together necessarily contain them all. That is read-your-writes, for the
price of FIFOs Mira was already paying, with no shared counter and no clock.
Sharding does not weaken it, because the argument never depended on there
being one queue: an acknowledged export is in exactly one shard’s channel
until that shard appends it. It does mean the read path has to ask all of
them, which is what fresh does.
Fields§
§shards: Arc<[Shard]>Empty for a slot nobody serves: fresh returns nothing, forever. That
is exactly what a unit test that only wants an Api wants.
Implementations§
Source§impl OpenSlot
impl OpenSlot
Sourcepub async fn fresh(&self) -> Vec<Arc<Open>>
pub async fn fresh(&self) -> Vec<Arc<Open>>
Everything acknowledged before this call, as one readable block per shard that has anything open.
Falls back to a shard’s last snapshot when its flusher cannot be reached: the request queue is full, or the task is gone. Both are overload or shutdown, and a query that waits its turn behind an overloaded ingest path is a worse answer than one that is a few milliseconds stale.
Every ask goes out before any answer is awaited, so the shards work concurrently; awaiting them in turn would put a whole flusher’s backlog between one shard’s answer and the next one’s question.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenSlot
impl RefUnwindSafe for OpenSlot
impl Send for OpenSlot
impl Sync for OpenSlot
impl Unpin for OpenSlot
impl UnsafeUnpin for OpenSlot
impl UnwindSafe for OpenSlot
Blanket Implementations§
impl<T> Allocation for T
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].