pub struct DeliveryWorker { /* private fields */ }Expand description
Background worker. Hold an Arc<DeliveryWorker> to share between
the HTTP task and any admin endpoints that manually flush the
queue.
Implementations§
Source§impl DeliveryWorker
impl DeliveryWorker
pub fn new(store: Store, config: DeliveryConfig) -> Self
Sourcepub async fn drain_once(&self) -> Result<DeliveryOutcome, OutboxError>
pub async fn drain_once(&self) -> Result<DeliveryOutcome, OutboxError>
Pop the next due delivery (if any) and attempt it exactly once. Returns the outcome so tests and observability surfaces can assert on the transition.
Sourcepub async fn enqueue_to_inboxes(
&self,
activity_id: &str,
inboxes: &[String],
) -> Result<usize, OutboxError>
pub async fn enqueue_to_inboxes( &self, activity_id: &str, inboxes: &[String], ) -> Result<usize, OutboxError>
Enqueue delivery of activity_id to an explicit list of inbox
URLs. This is the fan-out entry point used by outbox POST and
matches the JSS v0.0.67 deliverToFollowers pattern.
Returns the number of inboxes enqueued.
Sourcepub async fn run(self: Arc<Self>, tick: Duration)
pub async fn run(self: Arc<Self>, tick: Duration)
Long-running poller. Ticks every tick and calls
Self::drain_once until the queue is empty, then sleeps.
Auto Trait Implementations§
impl Freeze for DeliveryWorker
impl !RefUnwindSafe for DeliveryWorker
impl Send for DeliveryWorker
impl Sync for DeliveryWorker
impl Unpin for DeliveryWorker
impl UnsafeUnpin for DeliveryWorker
impl !UnwindSafe for DeliveryWorker
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