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 client (RESP or memcache). 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 driver does not reach into the cluster layer or the entropy reconciliation directly; both plug in through the Dispatcher hook the proxy installs, keeping the driver decoupled from routing and repair.

Structs§

ClientHandler
Client-side request handler bundle.

Enums§

ClientLoopOutcome
Outcome reported by client_loop when it finishes.

Traits§

ReplicaApplySink
Sink that applies an inbound cross-node object-replica op to the local datastore.

Functions§

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

Type Aliases§

BoxFuture
Boxed future returned by ReplicaApplySink::apply.