Skip to main content

Module extension

Module extension 

Source
Expand description

Command-dispatch extension hook.

The cluster substrate ships the parser, the dispatcher, and the standard data-plane commands (GET / SET / HSET / …). Layered surfaces - notably the RediSearch FT.* commands - plug in via the CommandExtension trait so the substrate does not need to know about them at compile time.

§Lifecycle

  1. The embedder constructs a crate::embed::ServerBuilder.
  2. The embedder (or a helper crate such as dynomite-search) attaches a CommandExtension via crate::embed::ServerBuilder::with_command_extension or crate::embed::ServerBuilder::set_command_extension.
  3. The dispatcher consults the extension in the hot path:
  4. When no extension is wired the dispatcher behaves exactly as it did before this hook existed: FT.* keywords are forwarded to the local datastore (which typically rejects them with -ERR unknown command).

Implementations are object-safe; the dispatcher holds an std::sync::Arc<dyn CommandExtension> and clones the handle freely across tasks.

Enums§

HsetOutcome
Outcome of CommandExtension::try_intercept_hset.

Traits§

CommandExtension
Pluggable command-dispatch hook.