Skip to main content

Module proxy

Module proxy 

Source
Expand description

axum proxy — boot, manifest reload, Mode 1 dispatch, worker pool, and the P9 Mode 2 SSR slice (response cache + cache-key composition + session + source generations). Mode 3 dispatch is stubbed (501) — wired up in P10. See .yah/docs/architecture/mesofact.md §“IPC protocol” and §“Components”.

§Why half of this is cfg(unix) (yah R918-T1)

The yah CLI links this crate transitively (yah -> cloud-admin / control-plane -> mesofact -> mesofact-core) purely for the SSR slice’s neutral halves — cache, session and source_gen are what mesofact_core’s lib re-exports. The serving half is a Unix daemon: the render pool talks to Bun workers over AF_UNIX and the manifest reloads on SIGHUP. Gating the daemon half keeps the neutral half reachable from a Windows build instead of making the whole crate unbuildable for it.

The split is exact rather than convenient: router is here because it imports worker_client and worker_pool, not because it is itself Unix-bound.

Modules§

cache
Mode 2 response cache — in-memory LRU keyed by the 7-input SHA-256 composition from .yah/docs/architecture/mesofact.md §“Cache-key composition”, with the fresh / stale (SWR) / expired state machine from §“Mode 2 caching beyond TTL”.
config
CLI configuration for the mesofact-proxy binary.
manifest_loader
Manifest loading: boot from a local file, plus SIGHUP-triggered reload and a 30-second heartbeat poll. Both signals push a new Arc<Manifest> through a tokio::sync::watch channel consumed by the router and worker pool.
metrics
Prometheus metrics for the proxy (/metrics exposition, scraped by yubaba).
router
axum router and request dispatch for the mesofact proxy.
session
Auth & session contract — the Rust proxy resolves req.user before render.
source_gen
Source generation tokens for cache-key input 6.
trace
W3C Trace Context (traceparent) generation + parsing for the proxy.
worker_client
WorkerClient — UDS connection to one Bun render-pool worker.
worker_pool
WorkerPool — manages N Bun render-pool workers.