pub enum DeliveryMode {
Immediate,
Queued,
}
Expand description
Specifies how and when an eviction notification should be delivered to an eviction listener.
For more details, see the document of sync::Cache
.
Variants§
Immediate
With this mode, a notification should be delivered to the listener
immediately after an entry was evicted. It also guarantees that eviction
notifications and cache write operations such and insert
, get_with
and
invalidate
for a given cache key are ordered by the time when they
occurred.
To guarantee the order, cache maintains key-level lock, which will reduce concurrent write performance.
Use this mode when the order is more import than the write performance.
Queued
With this mode, a notification will be delivered to the listener some time after an entry was evicted. Therefore, it does not preserve the order of eviction notifications and write operations.
On the other hand, cache does not maintain key-level lock, so there will be no overhead on write performance.
Use this mode when write performance is more important than preserving the order of eviction notifications and write operations.
Trait Implementations§
Source§impl Clone for DeliveryMode
impl Clone for DeliveryMode
Source§fn clone(&self) -> DeliveryMode
fn clone(&self) -> DeliveryMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more