pub struct JobRegistry { /* private fields */ }Implementations§
Source§impl JobRegistry
impl JobRegistry
pub fn new() -> Self
pub fn register<H>(&mut self, handler: H)where
H: JobHandler + 'static,
pub fn try_register<H>(&mut self, handler: H) -> Result<(), JobRegistryError>where
H: JobHandler + 'static,
pub fn try_register_boxed( &mut self, handler: Arc<dyn JobHandler>, ) -> Result<(), JobRegistryError>
Sourcepub fn register_retry_delay_override(
&mut self,
job_type: JobType<'static>,
failure_code: &'static str,
retry_delay_ms: i32,
)
pub fn register_retry_delay_override( &mut self, job_type: JobType<'static>, failure_code: &'static str, retry_delay_ms: i32, )
Registers the policy retry delay for one job type and failure code.
A lower bound attached directly to runledger_core::jobs::JobFailure
may extend this delay but can never shorten it. The worker uses its
exponential backoff when no matching override exists.
§Panics
Panics when retry_delay_ms is not positive.
pub fn get(&self, job_type: JobType<'_>) -> Option<Arc<dyn JobHandler>>
Sourcepub fn retry_delay_override(
&self,
job_type: JobType<'_>,
failure_code: &str,
) -> Option<i32>
pub fn retry_delay_override( &self, job_type: JobType<'_>, failure_code: &str, ) -> Option<i32>
Returns the configured policy retry delay for an exact job type and failure code.
Handler retry timing is a lower bound that may extend this policy delay but cannot shorten it.
pub fn registered_types(&self) -> Vec<JobType<'_>>
Trait Implementations§
Source§impl Clone for JobRegistry
impl Clone for JobRegistry
Source§fn clone(&self) -> JobRegistry
fn clone(&self) -> JobRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for JobRegistry
impl Default for JobRegistry
Source§fn default() -> JobRegistry
fn default() -> JobRegistry
Returns the “default value” for a type. Read more
Source§impl JobHandlerRegistry for JobRegistry
impl JobHandlerRegistry for JobRegistry
fn register_boxed(&mut self, handler: Arc<dyn JobHandler>)
fn register<H>(&mut self, handler: H)where
Self: Sized,
H: JobHandler + 'static,
Auto Trait Implementations§
impl !RefUnwindSafe for JobRegistry
impl !UnwindSafe for JobRegistry
impl Freeze for JobRegistry
impl Send for JobRegistry
impl Sync for JobRegistry
impl Unpin for JobRegistry
impl UnsafeUnpin for JobRegistry
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§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