|
ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
|
CDN edge-cache tier - mesh (sibling-cache) wire codec + async peer-query engine (PC_ENABLE_EDGE_MESH). More...
#include "protocore_config.h"Go to the source code of this file.
CDN edge-cache tier - mesh (sibling-cache) wire codec + async peer-query engine (PC_ENABLE_EDGE_MESH).
Lets a fleet of edge nodes share one warm cache. On a full local miss a node queries its sibling peers (over a plaintext ConnProto::PROTO_MESH TCP link) with a content-addressed request and pulls a fresh copy from whichever peer has it, instead of re-fetching the origin. Pull (read-through) only: no push, no invalidation. The transfer carries the object plus its freshness/age, so a sibling-fresh object serves for its remaining lifetime with zero origin contact (RFC 9111 age propagation).
This file is the pure, host-testable half: the request/response frame codec, the freshness-carrying entry frame (the shared ::edge_sd_serialize body plus a fixed timing trailer), and the async requester engine over the same EdgeFetchTransport seam the origin fetch uses (pc_client on device, a mock in host tests). The server glue (the peer table, the pre-origin query phase, and the PROTO_MESH serving listener) lives in edge_cache_proxy. Zero heap; fixed buffers.
Wire format (little-endian, versioned; magic 'E','M'): request : 'E' 'M' | ver=1 | op=GET(1) | digest[32] | u16 key_len + key | u16 hdrs_len + req_hdrs response: 'E' 'M' | ver=1 | status (MISS=0 / HIT=1) | [ u16 entry_len + entry_frame ] (entry on HIT) entry : timing trailer (i64 date | i64 expires | u32 lifetime_s | u32 age_hdr | u32 current_age) followed by an ::edge_sd_serialize body (content: key/status/ct/validators/encoding/Vary/body)
Definition in file edge_mesh.h.