pub struct EventProcessor<H: SubscriptionHandler, S: IdempotencyStore> { /* private fields */ }Expand description
Event processor that handles webhook events asynchronously
Implementations§
Source§impl<H: SubscriptionHandler, S: IdempotencyStore> EventProcessor<H, S>
impl<H: SubscriptionHandler, S: IdempotencyStore> EventProcessor<H, S>
Sourcepub fn new(
handler: Arc<H>,
idempotency_store: Arc<S>,
config: StripeWebhookConfig,
) -> (Self, ProcessorHandle<H, S>)
pub fn new( handler: Arc<H>, idempotency_store: Arc<S>, config: StripeWebhookConfig, ) -> (Self, ProcessorHandle<H, S>)
Create a new event processor
Sourcepub async fn queue_event(&self, event: StripeEvent) -> StripeWebhookResult<()>
pub async fn queue_event(&self, event: StripeEvent) -> StripeWebhookResult<()>
Queue an event for async processing
This returns immediately after queuing. The actual processing happens in a background task.
Sourcepub async fn process_event_sync(
&self,
event: &StripeEvent,
) -> StripeWebhookResult<()>
pub async fn process_event_sync( &self, event: &StripeEvent, ) -> StripeWebhookResult<()>
Process an event synchronously (for testing or immediate processing)
Auto Trait Implementations§
impl<H, S> Freeze for EventProcessor<H, S>
impl<H, S> RefUnwindSafe for EventProcessor<H, S>where
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<H, S> Send for EventProcessor<H, S>
impl<H, S> Sync for EventProcessor<H, S>
impl<H, S> Unpin for EventProcessor<H, S>
impl<H, S> UnwindSafe for EventProcessor<H, S>where
H: RefUnwindSafe,
S: RefUnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more