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.