Skip to main content

AsyncHotkeysCommands

Trait AsyncHotkeysCommands 

Source
pub trait AsyncHotkeysCommands:
    ConnectionLike
    + Send
    + Sync
    + Sized {
    // Provided methods
    fn hotkeys_start(&mut self, opts: HotkeysOptions) -> RedisFuture<'_, ()> { ... }
    fn hotkeys_get(&mut self) -> RedisFuture<'_, Option<HotkeysResponse>> { ... }
    fn hotkeys_stop(&mut self) -> RedisFuture<'_, bool> { ... }
    fn hotkeys_reset(&mut self) -> RedisFuture<'_, ()> { ... }
}
Expand description

Async version of HOTKEYS commands for standalone async connections (Redis 8.6.0+).

HOTKEYS is a stateful, node-local command requiring session affinity. It is ONLY implemented for standalone connection types and NOT for cluster clients.

Provided Methods§

Source

fn hotkeys_start(&mut self, opts: HotkeysOptions) -> RedisFuture<'_, ()>

Start tracking hot keys with the given options.

HOTKEYS START METRICS count [CPU] [NET] [COUNT k] [DURATION seconds] [SAMPLE ratio] [SLOTS count slot [slot ...]]

Redis Docs

Source

fn hotkeys_get(&mut self) -> RedisFuture<'_, Option<HotkeysResponse>>

Get the current hot keys metrics.

Returns Some(response) when a tracking session state is available (when there is an active tracking session or when the tracking session has been stopped but not reset) and None when there is no session state to report (Redis replies Nil in that case).

HOTKEYS GET

Redis Docs

Source

fn hotkeys_stop(&mut self) -> RedisFuture<'_, bool>

Stop tracking hot keys.

Returns true if a tracking session was running and has been stopped, or false if no session was active (Redis replies Nil in that case).

HOTKEYS STOP

Redis Docs

Source

fn hotkeys_reset(&mut self) -> RedisFuture<'_, ()>

Reset the hot keys tracking state.

Only valid when no tracking session is currently running. Calling RESET while a session is active returns a server error.

HOTKEYS RESET

Redis Docs

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl AsyncHotkeysCommands for MultiplexedConnection

Available on crate feature aio only.