Skip to main content

DeliveryMode

Enum DeliveryMode 

Source
pub enum DeliveryMode<'env, 'pool> {
    Pool(Option<&'env mut CallbackEnviron<'pool>>),
    Pumped,
    Signalled(Option<&'env mut CallbackEnviron<'pool>>),
}
Expand description

How an instance’s completions are drained: by the thread pool, or by the consumer’s own thread, which the pool may tell. Chosen once, as the instance is built, and not changed after.

Variants§

§

Pool(Option<&'env mut CallbackEnviron<'pool>>)

Drained on a pool thread whenever the ring’s completion event says to, and the consumer told through DurableRing::readiness. Holds the thread pool, and the priority within it, that delivery runs on – a NUMA node’s own pool, for one; None is the process’s default pool. Read once, as the instance is built.

§

Pumped

Drained by the consumer’s own thread, which calls Dioring::pump: no thread of the instance’s own, and none of the pool’s. Nothing is drained until it does. Its pump waits on the ring’s own completion event, a handle to which Dioring::completion_event offers the consumer, to wait on beside its own handles before it pumps.

§

Signalled(Option<&'env mut CallbackEnviron<'pool>>)

Drained by the consumer’s own thread, as Pumped, which the thread pool tells: it sets an event of the instance’s own, Dioring::completion_signal, whenever completions may be waiting, and the consumer waits on that beside its own handles and then calls Dioring::pump. A thread-pool wait holds no thread while it waits; its callback only sets the event. Holds the thread pool, and the priority within it, that callback runs on, as Pool’s does.

Auto Trait Implementations§

§

impl<'env, 'pool> !Send for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> !Sync for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> !UnwindSafe for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> Freeze for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> RefUnwindSafe for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> Unpin for DeliveryMode<'env, 'pool>

§

impl<'env, 'pool> UnsafeUnpin for DeliveryMode<'env, 'pool>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.