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
- The embedder constructs a
crate::embed::ServerBuilder. - The embedder (or a helper crate such as
dynomite-search) attaches aCommandExtensionviacrate::embed::ServerBuilder::with_command_extensionorcrate::embed::ServerBuilder::set_command_extension. - The dispatcher consults the extension in the hot path:
- For commands the parser tags as
crate::msg::MsgType::ReqRedisFtCreate/crate::msg::MsgType::ReqRedisFtSearch/crate::msg::MsgType::ReqRedisFtInfo/crate::msg::MsgType::ReqRedisFtList/crate::msg::MsgType::ReqRedisFtDropindex/crate::msg::MsgType::ReqRedisFtRegex/crate::msg::MsgType::ReqRedisFtSugadd/crate::msg::MsgType::ReqRedisFtSugget/crate::msg::MsgType::ReqRedisFtSugdel/crate::msg::MsgType::ReqRedisFtSuglen/crate::msg::MsgType::ReqRedisFtUnknownthe dispatcher checksCommandExtension::handles_msg_typeand, if true, delegates execution toCommandExtension::try_dispatch. - Every HSET request is offered to
CommandExtension::try_intercept_hsetbefore the standard fan-out path runs.
- For commands the parser tags as
- 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§
- Hset
Outcome - Outcome of
CommandExtension::try_intercept_hset.
Traits§
- Command
Extension - Pluggable command-dispatch hook.