pub struct ProcessingContext<P, C, S>where
P: RecordProcessor + Send + Sync + 'static,
C: KinesisClientTrait + Send + Sync + Clone + 'static,
S: CheckpointStore + Send + Sync + Clone + 'static,{
processor: Arc<P>,
client: Arc<C>,
store: Arc<S>,
config: ProcessorConfig,
monitoring_tx: Option<Sender<ProcessingEvent>>,
}
Expand description
Internal context holding processor state and dependencies
Fields§
§processor: Arc<P>
The user-provided record processor implementation
client: Arc<C>
AWS Kinesis client
store: Arc<S>
Checkpoint storage implementation
config: ProcessorConfig
Processor configuration
monitoring_tx: Option<Sender<ProcessingEvent>>
Channel for sending monitoring events
Implementations§
source§impl<P, C, S> ProcessingContext<P, C, S>where
P: RecordProcessor + Send + Sync + 'static,
C: KinesisClientTrait + Send + Sync + Clone + 'static,
S: CheckpointStore + Send + Sync + Clone + 'static,
impl<P, C, S> ProcessingContext<P, C, S>where
P: RecordProcessor + Send + Sync + 'static,
C: KinesisClientTrait + Send + Sync + Clone + 'static,
S: CheckpointStore + Send + Sync + Clone + 'static,
sourcepub fn new(
processor: P,
client: C,
store: S,
config: ProcessorConfig,
monitoring_tx: Option<Sender<ProcessingEvent>>,
) -> Self
pub fn new( processor: P, client: C, store: S, config: ProcessorConfig, monitoring_tx: Option<Sender<ProcessingEvent>>, ) -> Self
Creates a new processing context
§Arguments
processor
- The record processor implementationclient
- AWS Kinesis clientstore
- Checkpoint storage implementationconfig
- Processor configurationmonitoring_tx
- Optional channel for monitoring events
sourceasync fn send_monitoring_event(&self, event: ProcessingEvent)
async fn send_monitoring_event(&self, event: ProcessingEvent)
Sends a monitoring event if monitoring is enabled
sourcefn is_iterator_expired(&self, error: &KinesisClientError) -> bool
fn is_iterator_expired(&self, error: &KinesisClientError) -> bool
Checks if an error indicates an expired iterator
Trait Implementations§
source§impl<P: RecordProcessor, C: KinesisClientTrait + Clone, S: CheckpointStore + Clone> Clone for ProcessingContext<P, C, S>
impl<P: RecordProcessor, C: KinesisClientTrait + Clone, S: CheckpointStore + Clone> Clone for ProcessingContext<P, C, S>
Auto Trait Implementations§
impl<P, C, S> Freeze for ProcessingContext<P, C, S>
impl<P, C, S> RefUnwindSafe for ProcessingContext<P, C, S>
impl<P, C, S> Send for ProcessingContext<P, C, S>
impl<P, C, S> Sync for ProcessingContext<P, C, S>
impl<P, C, S> Unpin for ProcessingContext<P, C, S>
impl<P, C, S> UnwindSafe for ProcessingContext<P, C, S>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.