Skip to main content

Module client

Module client 

Source
Expand description

CLIENT-role connection driver.

The CLIENT role is the engine’s view of an inbound connection from a Redis or memcache client. The driver:

  1. Reads bytes from the crate::io::reactor::Transport into the connection’s recv mbuf chain.
  2. Drives the appropriate datastore parser (crate::proto::redis::redis_parse_req or crate::proto::memcache::memcache_parse_req) over the chain.
  3. Hands every fully-parsed request to the configured crate::net::Dispatcher and waits for a response on the per-connection mpsc channel.
  4. Writes the response bytes back to the transport.

The driver runs a single tokio select! per iteration, draining pending response bytes first so the loop’s read / write arms never block on a saturated peer.

The Stage 9 implementation does not yet reach into the cluster layer (Stage 10) or the entropy reconciliation (Stage 11); those plug in through the Dispatcher hook the proxy installs.

Structs§

ClientHandler
Client-side request handler bundle.

Enums§

ClientLoopOutcome
Outcome reported by client_loop when it finishes.

Functions§

client_loop
Drive the client FSM until the peer closes or the dispatcher asks the driver to exit.