Skip to main content

SequencerHandle

Struct SequencerHandle 

Source
pub struct SequencerHandle { /* private fields */ }
Expand description

Cloneable client handle; one per workspace/agent.

Implementations§

Source§

impl SequencerHandle

Source

pub fn durability_failed(&self) -> bool

Whether a durability barrier has failed, after which this writer refuses every submission.

Exposed rather than acted on. The sequencer’s job is to say that it can no longer promise durability; deciding what a node does about that — keep serving reads, exit so supervision restarts it, page someone — is a lifecycle policy, and a library linked by every embedder including the test suite is the wrong place to make it.

The daemon polls this and exits, so launchd’s KeepAlive restarts into the same replay path a kill -9 already exercises. Without an observer, fail-closed is invisible to supervision: the process stays up refusing everything, and a transient fsync error becomes permanent downtime that looks like uptime.

Source

pub fn submit(&self, channel: &str, payload: Vec<u8>) -> Accepted

Blocks until the sequencer has durably ordered the op. Unsigned convenience wrapper over SequencerHandle::try_submit; only valid under a policy that admits unsigned ops.

§Panics

Panics if the sequencer thread has shut down or the policy rejects the op.

Source

pub fn try_submit( &self, channel: &str, payload: Vec<u8>, author_sig: Option<Witness>, ) -> Result<Accepted, String>

Blocks until the sequencer has ordered the op or rejected it.

§Errors

The policy’s rejection reason, or a fairness rejection naming the quota when this actor already has too many ops awaiting a decision. The quota is checked here, on the calling thread, before anything is sent: an over-quota submitter is answered, never parked, so a client always has something to react to.

§Panics

Panics if the sequencer thread has already shut down.

Source

pub fn quotas(&self) -> Quotas

The per-actor admission quotas this handle submits through.

Source

pub fn try_submit_many( &self, subs: Vec<Submission>, ) -> Vec<Result<Accepted, String>>

Offers every submission before waiting for any reply, so the whole group is already queued when the writer next drains — and therefore shares one durability barrier instead of one each.

This is the difference between an N-op request costing N fsyncs and costing ceil(N / MAX_BATCH). Calling SequencerHandle::try_submit in a loop cannot achieve it: each call blocks until its own reply, so the queue is empty every time the writer looks and every op becomes its own batch.

Results are returned in submission order, one per input. Each is independent: a rejection does not abort the rest, matching the per-op semantics /api/submit-batch already promised.

§Panics

Panics if the sequencer thread has already shut down.

Trait Implementations§

Source§

impl Clone for SequencerHandle

Source§

fn clone(&self) -> SequencerHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.