|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
CDN edge-cache tier - server glue (PROTOCORE_ENABLE_EDGE_CACHE). More...
#include "protocore_config.h"Go to the source code of this file.
Classes | |
| struct | EdgeProxyNs |
| Dispatch table. Addressed by offset, so the layout is asserted below. More... | |
Functions | |
| PROTOCORE_NS_LAYOUT (EdgeProxyNs, enable, map, bind_sd, add_peer, mesh_serve, reset, purge, purge_prefix, stats) | |
| void | protocore_edge_proxy_enable (uint8_t *work) |
| Enable the edge cache on server: register the cache middleware + . | |
| proto_bool | protocore_edge_proxy_map (uint8_t *work, const char *path_prefix, const char *origin_base_url) |
| Map a request path prefix to an upstream origin (e.g. "/cdn/" -> . | |
| void | protocore_edge_proxy_bind_sd (uint8_t *work, struct protocore_dbm *dbm) |
| Bind an L2 persistent tier: an opened dbm handle (on a mounted WAL . | |
| proto_bool | protocore_edge_proxy_add_peer (uint8_t *work, const char *host, uint16_t port) |
| Add a sibling peer to query on a full local miss before hitting the . | |
| void | protocore_edge_proxy_mesh_serve (uint8_t *work) |
| Serve sibling queries: register the PROTO_MESH handler so this node . | |
| void | protocore_edge_proxy_reset (uint8_t *work) |
| Clear the L1 store, the L2 store (if bound), all route maps, and . | |
| proto_bool | protocore_edge_proxy_purge (uint8_t *work, const char *canonical_key) |
| Invalidate a single canonical key. true if an entry was purged. | |
| uint32_t | protocore_edge_proxy_purge_prefix (uint8_t *work, const char *path_prefix) |
| Invalidate every entry whose request path begins with prefix. the . | |
| void | protocore_edge_proxy_stats (uint8_t *work, struct EdgeCacheStats *out) |
| Snapshot the cache counters. | |
| uint8_t * | protocore_edge_cache_proxy_span (void) |
| The PROTOCORE_EDGE_PROXY_BORROW bytes this module's state lives in. | |
Variables | |
| PROTOCORE_NS EdgeProxyNs EdgeProxy | PROTOCORE_UNUSED |
| Module namespace. | |
CDN edge-cache tier - server glue (PROTOCORE_ENABLE_EDGE_CACHE).
Wires the pure engine (edge_cache) + async fetch (edge_fetch) into a PC: registers the cache as a middleware and installs the async-fetch poll hook, maps request path prefixes to upstream origins (fetched over protocore_client), and serves hits with the constant-memory send-pump. A miss or a stale-entry revalidation suspends the client request and drives the origin fetch from the slot's poll, so the worker never stalls; every failure path fails open. Purge + stats round it out.
work is PROTOCORE_EDGE_PROXY_BORROW bytes the CALLER took, at an address it knows. It is not held past the call, so nothing here aliases it. How those bytes are carved is this module's and is never named here.
Definition in file edge_cache_proxy.h.
| PROTOCORE_NS_LAYOUT | ( | EdgeProxyNs | , |
| enable | , | ||
| map | , | ||
| bind_sd | , | ||
| add_peer | , | ||
| mesh_serve | , | ||
| reset | , | ||
| purge | , | ||
| purge_prefix | , | ||
| stats | |||
| ) |
| void protocore_edge_proxy_enable | ( | uint8_t * | work | ) |
Enable the edge cache on server: register the cache middleware + .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| proto_bool protocore_edge_proxy_map | ( | uint8_t * | work, |
| const char * | path_prefix, | ||
| const char * | origin_base_url | ||
| ) |
Map a request path prefix to an upstream origin (e.g. "/cdn/" -> .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| path_prefix | Path prefix |
| origin_base_url | Origin base url |
| void protocore_edge_proxy_bind_sd | ( | uint8_t * | work, |
| struct protocore_dbm * | dbm | ||
| ) |
Bind an L2 persistent tier: an opened dbm handle (on a mounted WAL .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| dbm | Dbm |
| proto_bool protocore_edge_proxy_add_peer | ( | uint8_t * | work, |
| const char * | host, | ||
| uint16_t | port | ||
| ) |
Add a sibling peer to query on a full local miss before hitting the .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| host | Host |
| port | Port |
| void protocore_edge_proxy_mesh_serve | ( | uint8_t * | work | ) |
Serve sibling queries: register the PROTO_MESH handler so this node .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| void protocore_edge_proxy_reset | ( | uint8_t * | work | ) |
Clear the L1 store, the L2 store (if bound), all route maps, and .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| proto_bool protocore_edge_proxy_purge | ( | uint8_t * | work, |
| const char * | canonical_key | ||
| ) |
Invalidate a single canonical key. true if an entry was purged.
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| canonical_key | Canonical key |
| uint32_t protocore_edge_proxy_purge_prefix | ( | uint8_t * | work, |
| const char * | path_prefix | ||
| ) |
Invalidate every entry whose request path begins with prefix. the .
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| path_prefix | Path prefix |
| void protocore_edge_proxy_stats | ( | uint8_t * | work, |
| struct EdgeCacheStats * | out | ||
| ) |
Snapshot the cache counters.
| work | PROTOCORE_EDGE_PROXY_BORROW bytes the caller took. Not held past the call. |
| out | Out |
| uint8_t * protocore_edge_cache_proxy_span | ( | void | ) |
The PROTOCORE_EDGE_PROXY_BORROW bytes this module's state lives in.
Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.
| PROTOCORE_NS EdgeProxyNs EdgeProxy PROTOCORE_UNUSED |
Module namespace.
Definition at line 118 of file edge_cache_proxy.h.