Struct EventReactor

Source
pub struct EventReactor<'a, T, E, G>
where T: StreamConsumer<E, G>, E: StreamEntry, G: ConsumerGroup,
{ /* private fields */ }
Expand description

Redis event stream reactor

Implementations§

Source§

impl<'a, T, E, G> EventReactor<'a, T, E, G>
where T: StreamConsumer<E, G>, E: StreamEntry, G: ConsumerGroup,

Source

pub fn new(data: T::Data, stream_key: Cow<'a, str>) -> Self

Source

pub async fn initialize_consumer_group( &mut self, ) -> Result<ConsumerGroupState, RedisError>

Manually initialize Redis consumer group; this will otherwise initialize automatically as needed and is useful for knowing if a consumer group was previously created

Source

pub async fn clear_idle_backlog( &mut self, min_idle: &Duration, max_idle: &Option<Duration>, ) -> Result<(), RedisError>

Process idle-pending backlog without claiming new entries until none remain and max_idle has elapsed (relative to start_time)

Source

pub async fn start_reactor( &mut self, claim_mode: ClaimMode, ) -> Result<(), RedisError>

Process redis stream entries until shutdown signal received

Source

pub fn shutdown_token(&self) -> Arc<CancellationToken>

Auto Trait Implementations§

§

impl<'a, T, E, G> Freeze for EventReactor<'a, T, E, G>
where <T as StreamConsumer<E, G>>::Data: Freeze,

§

impl<'a, T, E, G> RefUnwindSafe for EventReactor<'a, T, E, G>

§

impl<'a, T, E, G> Send for EventReactor<'a, T, E, G>

§

impl<'a, T, E, G> Sync for EventReactor<'a, T, E, G>

§

impl<'a, T, E, G> Unpin for EventReactor<'a, T, E, G>
where <T as StreamConsumer<E, G>>::Data: Unpin,

§

impl<'a, T, E, G> UnwindSafe for EventReactor<'a, T, E, G>
where T: RefUnwindSafe, <T as StreamConsumer<E, G>>::Data: UnwindSafe,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,