pub struct Dispatcher { /* private fields */ }Expand description
Sends webhook deliveries (cheap to clone).
Implementations§
Source§impl Dispatcher
impl Dispatcher
pub fn from_config(config: &Config) -> Result<Dispatcher>
pub fn new(public_url: &str, config: &WebhookConfig) -> Result<Dispatcher>
Sourcepub fn with_lookup(
public_url: &str,
config: &WebhookConfig,
lookup: Lookup,
) -> Result<Dispatcher>
pub fn with_lookup( public_url: &str, config: &WebhookConfig, lookup: Lookup, ) -> Result<Dispatcher>
A dispatcher whose connections resolve host names with lookup
(tests; Dispatcher::new uses the system resolver).
pub fn policy(&self) -> &TargetPolicy
Sourcepub async fn run_once(&self, pool: &PgPool) -> AppResult<Report>
pub async fn run_once(&self, pool: &PgPool) -> AppResult<Report>
Sends the due deliveries (up to BATCH at once).
Sourcepub async fn deliver_now(
&self,
pool: &PgPool,
delivery_id: Uuid,
) -> AppResult<Option<Outcome>>
pub async fn deliver_now( &self, pool: &PgPool, delivery_id: Uuid, ) -> AppResult<Option<Outcome>>
Sends one due delivery now (“Send test”, “Retry” – both make it due
at once). None if it is not pending, or another sender holds it:
a claimed row is leased (next_attempt_at in the future) and must
not be sent a second time while that attempt may still be running.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Dispatcher
impl !UnwindSafe for Dispatcher
impl Freeze for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreimpl<T> Parallelizable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.