Expand description
Engine selection + the pre-serialized static-response table — the cross-platform half of the HTTP fast path.
LOGOS serves HTTP everywhere; the ENGINE is a knob. Two engines exist:
- tokio — the portable baseline in
super::server. Always compiled, works on every native platform, and is the only engine for the interpreter tier (whose!Sendhandler drivesListener/Conninline). - uring — the Linux thread-per-core io_uring engine in
engine_uring(behind theio-uringfeature). The compiled (AOT) tier’s fast path: its handlers are plainFns, exactly the engine’s contract.
choose_engine is the ONE selection law, applied by the serve entries in
server.rs: LOGOS_HTTP_ENGINE=uring|tokio overrides; the default is
uring wherever a probe ring actually initializes (Linux, io-uring feature
compiled in, kernel support present), else tokio. Selection is ALWAYS
announced with one stderr line — loud, never silent — so a deploy can never
quietly run the slow path.
Structs§
- Engine
Choice - The outcome of
choose_engine: the engine plus the human-readable reason that goes on stderr. - Static
Responses - Pre-serialized static responses — the memcpy fast path.
Enums§
- Engine
Kind - Which engine a serve entry runs on.
Functions§
- announce
- The one loud line: which engine this serve entry runs on, and why.
- choose_
engine - Read the selection knobs from the environment and apply
choose_engine_from.LOGOS_HTTP_FORCE_FALLBACK=1makes the uring probe fail artificially (the fallback-honesty test hook — it exercises the same path a ring-init failure takes on a real kernel without io_uring). - choose_
engine_ from - The pure selection law.
probeinitializes a throwaway ring (or explains why it cannot); it runs only when uring is actually a candidate. - lifecycle_
knob_ requested - The name of the first lifecycle knob the environment sets, if any — the pure half of the rule above, so it can be tested without the process environment.
- shard_
count_ from - The shard-count law for the uring engine:
LOGOS_HTTP_SHARDSwhen it parses to a positive count (clamped to 1024), else the box’s available parallelism, else 1. Pure so it is testable without touching the process environment.