pub struct MmapConsumer<E> { /* private fields */ }Expand description
Consumer for the mmap transport.
Implementations§
Source§impl<E> MmapConsumer<E>
impl<E> MmapConsumer<E>
Sourcepub fn attach(
layout: MmapTransportLayout,
buffer_size: usize,
consumer_id: &str,
) -> MultiProcessResult<Self>
pub fn attach( layout: MmapTransportLayout, buffer_size: usize, consumer_id: &str, ) -> MultiProcessResult<Self>
Attach a consumer to an existing mmap transport.
Sourcepub fn signal_readiness(&self)
pub fn signal_readiness(&self)
Signal that this consumer is ready.
Sourcepub fn has_coordination_support(&self) -> bool
pub fn has_coordination_support(&self) -> bool
Return whether this consumer has a readiness cursor attached.
Sourcepub fn try_consume_next(&mut self) -> Option<(Sequence, E)>
pub fn try_consume_next(&mut self) -> Option<(Sequence, E)>
Try to consume the next available event.
Sourcepub fn try_consume_next_leased(&mut self) -> Option<MmapConsumerLease<'_, E>>
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.
Sourcepub fn process_available<F>(&mut self, processor: F) -> usize
pub fn process_available<F>(&mut self, processor: F) -> usize
Process all currently available events.
Sourcepub fn consume_next(&mut self) -> (Sequence, E)
pub fn consume_next(&mut self) -> (Sequence, E)
Block until one event is available, then consume it.
Sourcepub fn consume_next_with_sleep(&mut self) -> (Sequence, E)
pub fn consume_next_with_sleep(&mut self) -> (Sequence, E)
Block until one event is available, then consume it with the configured sleep policy.
Sourcepub fn consume_next_leased(&mut self) -> MmapConsumerLease<'_, E>
pub fn consume_next_leased(&mut self) -> MmapConsumerLease<'_, E>
Block until one event is available, then lease it.
Sourcepub fn consume_next_leased_with_sleep(&mut self) -> MmapConsumerLease<'_, E>
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.
Sourcepub fn current_sequence(&self) -> Sequence
pub fn current_sequence(&self) -> Sequence
Return the last processed sequence.
Sourcepub fn consumer_id(&self) -> &str
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> 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
Mutably borrows from an owned value. Read more