pub struct ClientTracking { /* private fields */ }Expand description
CLIENT TRACKING ON|OFF [REDIRECT client-id] [PREFIX prefix] [BCAST] [OPTIN] [OPTOUT] [NOLOOP]
Enable or disable server-assisted client-side caching.
Implementations§
Source§impl ClientTracking
impl ClientTracking
Sourcepub fn on() -> ClientTracking
pub fn on() -> ClientTracking
Enable client tracking.
Sourcepub fn off() -> ClientTracking
pub fn off() -> ClientTracking
Disable client tracking.
Sourcepub fn redirect(self, client_id: i64) -> ClientTracking
pub fn redirect(self, client_id: i64) -> ClientTracking
Redirect invalidation messages to another connection’s client ID.
The ID can be obtained with ClientId. Redirecting is useful when a
dedicated RESP3 connection owns the invalidation push stream while a
separate connection executes data commands.
Sourcepub fn bcast(self) -> ClientTracking
pub fn bcast(self) -> ClientTracking
Enable broadcasting mode (invalidate all keys matching prefixes).
Sourcepub fn prefix(self, prefix: impl AsRef<[u8]>) -> ClientTracking
pub fn prefix(self, prefix: impl AsRef<[u8]>) -> ClientTracking
Add a binary-safe key prefix to track and enable BCAST mode.
Sourcepub fn optin(self) -> ClientTracking
pub fn optin(self) -> ClientTracking
Enable opt-in mode (only track keys after CLIENT CACHING YES).
Sourcepub fn optout(self) -> ClientTracking
pub fn optout(self) -> ClientTracking
Enable opt-out mode (track all keys, skip after CLIENT CACHING NO).
Sourcepub fn noloop(self) -> ClientTracking
pub fn noloop(self) -> ClientTracking
Suppress invalidations caused by writes on the tracked connection.
Cached clients must pair this with synchronous local write invalidation so their own writes cannot leave stale entries behind.
Trait Implementations§
Source§impl Clone for ClientTracking
impl Clone for ClientTracking
Source§fn clone(&self) -> ClientTracking
fn clone(&self) -> ClientTracking
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Command for ClientTracking
impl Command for ClientTracking
Source§fn parse_response(
&self,
frame: Frame,
) -> Result<<ClientTracking as Command>::Response, RedisError>
fn parse_response( &self, frame: Frame, ) -> Result<<ClientTracking as Command>::Response, RedisError>
Source§fn idempotent(&self) -> bool
fn idempotent(&self) -> bool
Source§fn is_blocking(&self) -> bool
fn is_blocking(&self) -> bool
BLPOP, BRPOP, BLMOVE, BZPOPMIN/BZPOPMAX, and
XREAD/XREADGROUP with BLOCK. Read more