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
impl Retry
Sourcepub fn applied(self, had: u64) -> u64
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.