pub struct PgOutboxWorkerBuilder { /* private fields */ }Expand description
Fluent builder for an OutboxWorker backed by PgOutboxStore.
Implementations§
Source§impl PgOutboxWorkerBuilder
impl PgOutboxWorkerBuilder
Sourcepub fn table_name(self, name: impl Into<String>) -> Self
pub fn table_name(self, name: impl Into<String>) -> Self
Override the outbox table name (default "audit_outbox").
Sourcepub fn register_handler<E, H>(self, handler: H) -> Self
pub fn register_handler<E, H>(self, handler: H) -> Self
Register a typed handler for the event type E.
Registering twice for the same event type silently replaces the previous handler.
Register a handler already shared behind an Arc.
Sourcepub fn poll_interval(self, d: Duration) -> Self
pub fn poll_interval(self, d: Duration) -> Self
Override the poll interval (default 100 ms).
Sourcepub fn batch_size(self, n: usize) -> Self
pub fn batch_size(self, n: usize) -> Self
Override the batch size per poll (default 10).
Sourcepub fn max_attempts(self, n: u32) -> Self
pub fn max_attempts(self, n: u32) -> Self
Override the maximum number of attempts per envelope (default 5).
Sourcepub fn retry_delay(self, d: Duration) -> Self
pub fn retry_delay(self, d: Duration) -> Self
Override the constant retry delay between failed attempts (default 5 s).
Sourcepub fn build(self) -> Result<OutboxWorker<PgOutboxStore>, OutboxError>
pub fn build(self) -> Result<OutboxWorker<PgOutboxStore>, OutboxError>
Consume the builder and produce an OutboxWorker ready to spawn.
§Errors
Returns OutboxError::Internal if the configured table_name
is not a valid identifier.
Auto Trait Implementations§
impl Freeze for PgOutboxWorkerBuilder
impl !RefUnwindSafe for PgOutboxWorkerBuilder
impl Send for PgOutboxWorkerBuilder
impl Sync for PgOutboxWorkerBuilder
impl Unpin for PgOutboxWorkerBuilder
impl UnsafeUnpin for PgOutboxWorkerBuilder
impl !UnwindSafe for PgOutboxWorkerBuilder
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