DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
redis_resp.h File Reference

Redis RESP2/RESP3 wire codec (DETWS_ENABLE_REDIS) - zero-heap command encoder + reply parser, so a device can talk to a Redis server with the shipped outbound client transport. More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

Redis RESP2/RESP3 wire codec (DETWS_ENABLE_REDIS) - zero-heap command encoder + reply parser, so a device can talk to a Redis server with the shipped outbound client transport.

RESP (https://redis.io/docs/latest/develop/reference/protocol-spec):

  • A command is an array of bulk strings: *<n>\r\n$<len>\r\n<arg>\r\n....
  • A RESP2 reply is one of: simple string +OK\r\n, error -ERR ...\r\n, integer :<n>\r\n, bulk string $<len>\r\n<bytes>\r\n ($-1\r\n = nil), or array *<n>\r\n<elements> (*-1\r\n = nil).
  • RESP3 adds: null _\r\n, boolean #t\r\n/#f\r\n, double ,<x>\r\n, big number (<digits>\r\n, bulk error !<len>\r\n..., verbatim string =<len>\r\n<fmt>:<text>\r\n, map %<pairs>\r\n, set ~<n>\r\n, push ><n>\r\n.

The parser is a cursor: it decodes one value at the buffer head and reports how many bytes it consumed; for an aggregate (array / set / push / map) it reports the following child count and the caller parses each child from the remaining bytes (no recursion state, no heap). A map of N pairs reports count 2*N.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file redis_resp.h.