Skip to main content

Retry

Enum Retry 

Source
pub enum Retry {
    Down,
    Keep,
    Max,
    At(u64),
}
Expand description

What releasing an entry does to its delivery count.

XNACK takes one of three words for this and they only differ here. A worker that could not do the job because the machine it was on went away wants the attempt not to count, one that failed the way work sometimes fails wants the count left alone, and one that has decided the message itself is the problem wants nobody to try it again.

Variants§

§

Down

SILENT: take one off the count, as if the delivery had not happened.

§

Keep

FAIL: leave the count where it is, and start a new entry at zero.

§

Max

FATAL: put the count as high as it goes.

§

At(u64)

RETRYCOUNT n: put the count at exactly this, whatever the word said.

Implementations§

Source§

impl Retry

Source

pub fn applied(self, had: u64) -> u64

The count an entry that was on had ends up with.

Retry::Down takes one off rather than putting the count back to zero, which is worth saying because the two look the same on an entry that has only been handed out once and that is the entry most people try it on. A message that has killed four workers and is then released by a fifth for a reason that was nothing to do with the message reads as three, not as new. It saturates, so a released entry that is released again stays at zero rather than wrapping.

Retry::Max is i64::MAX and not u64::MAX because that is the number Redis reports, and a client that reads the count into a signed integer, which is what the protocol hands it, has to be able to hold it.

Trait Implementations§

Source§

impl Clone for Retry

Source§

fn clone(&self) -> Retry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Retry

Source§

impl Debug for Retry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Retry

Source§

impl PartialEq for Retry

Source§

fn eq(&self, other: &Retry) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Retry

Auto Trait Implementations§

§

impl Freeze for Retry

§

impl RefUnwindSafe for Retry

§

impl Send for Retry

§

impl Sync for Retry

§

impl Unpin for Retry

§

impl UnsafeUnpin for Retry

§

impl UnwindSafe for Retry

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.