Skip to main content

MmapConsumer

Struct MmapConsumer 

Source
pub struct MmapConsumer<E> { /* private fields */ }
Expand description

Consumer for the mmap transport.

Implementations§

Source§

impl<E> MmapConsumer<E>
where E: Copy + Default,

Source

pub fn attach( layout: MmapTransportLayout, buffer_size: usize, consumer_id: &str, ) -> MultiProcessResult<Self>

Attach a consumer to an existing mmap transport.

Source

pub fn signal_readiness(&self)

Signal that this consumer is ready.

Source

pub fn has_coordination_support(&self) -> bool

Return whether this consumer has a readiness cursor attached.

Source

pub fn try_consume_next(&mut self) -> Option<(Sequence, E)>

Try to consume the next available event.

Source

pub fn try_consume_next_leased(&mut self) -> Option<MmapConsumerLease<'_, E>>

Try to lease the next available event without copying it out of the ring slot.

Source

pub fn process_available<F>(&mut self, processor: F) -> usize
where F: FnMut(&E, Sequence),

Process all currently available events.

Source

pub fn consume_next(&mut self) -> (Sequence, E)

Block until one event is available, then consume it.

Source

pub fn consume_next_with_sleep(&mut self) -> (Sequence, E)

Block until one event is available, then consume it with the configured sleep policy.

Source

pub fn consume_next_leased(&mut self) -> MmapConsumerLease<'_, E>

Block until one event is available, then lease it.

Source

pub fn consume_next_leased_with_sleep(&mut self) -> MmapConsumerLease<'_, E>

Block until one event is available, then lease it with the configured sleep policy.

Source

pub fn current_sequence(&self) -> Sequence

Return the last processed sequence.

Source

pub fn consumer_id(&self) -> &str

Return the logical consumer id.

Auto Trait Implementations§

§

impl<E> Freeze for MmapConsumer<E>

§

impl<E> !RefUnwindSafe for MmapConsumer<E>

§

impl<E> Send for MmapConsumer<E>

§

impl<E> Sync for MmapConsumer<E>

§

impl<E> Unpin for MmapConsumer<E>

§

impl<E> UnsafeUnpin for MmapConsumer<E>

§

impl<E> !UnwindSafe for MmapConsumer<E>

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 = 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V