pub enum RLUStrategy {
    Abort,
    Retry,
    RetryWithBreaker(BusyBreaker),
}
Expand description

Additional configuration for RLU. The internal execution can be either crate::RLUStrategy::Abort, if operation failed, crate::RLUStrategy::Retry again an unlimited number of times, or crate::RLUStrategy::RetryWithBreaker with a busy breaker.

Variants

Abort

Abort execution on failure

Retry

Retry executing the calling function repeatedly until it succeeds. A possible used case for this might be to check for a record again and again, until the corresponding write has occured. The number of internal retries should be really small in order to avoid any deadlocks.

RetryWithBreaker(BusyBreaker)

Try with a exponential breaker. Using a breaker that trips after an configurable amount of time is a trade-off between correctness of writes and code that tries to access a value that may not exists yet, but will be written by a future call into RLU augmented data structures. One such situation might occur, when integrating RLU into eg. a Cache data structure, where data is written and read from concurrently. Another calling process might assume the existence of a value, but writes to it might not be finished but will eventually land. This case can be mitigated by a “normal” retry, as the write can eventually be retrieved to be read.

If it is uncertain, that a write has occured a retry with the breaker might give enough time to wait for the write, while not creating an infinite busy wait on the calling thread.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.