Expand description
engine_loop — native 薄壳(pump 核已下沉 helix-driver-host::engine)。
§下沉后的分工
pump 核(BoundedSpawner / OwnedEffect+consume_effects / dispatch_effects /
TimerRegistry / run_http_envelope / 双通道 biased select + graceful drain)统一在
helix-driver-host::engine(泛型 over Storage/HttpRequester/EventSink/FrameSender/Clock)。
native 这层只保留:
- 具体 ports 装配(
NativeStorage/NativeHttp/NativeEventSink/NativeClock) - 与现网兼容的公开 API 签名(
EngineConfig/TransportTable/run_engine_loop) - tick 源接线(
SharedWsClient::with_inbound_tick,在transport.rs)
NativeEventSink(broadcast egress)特化留 native;(下一轮)FFI 传批处理 vtable sink, 共用同一 host 泛型壳,只差 egress + tick 源。
§五不变量真源
五不变量(回灌必达 / 主循环不等 I/O / 同 key 写序 / 回灌优先 / graceful drain)
的实现与文档真源现在在 helix-driver-host::engine 头注 + 本 crate AGENTS.md。
Structs§
- Engine
Config - 事件泵配置(native 具体 ports 聚合)。
Functions§
- rows_
from_ reply_ bytes - Decode
rows_to_reply_bytesoutput for driver compatibility paths. - rows_
to_ reply_ bytes - Encode storage rows as the canonical JSON array used by
PortReply. - run_
engine_ loop - 运行 ExecutionShell 的 tokio 事件泵(native 入口,无 transport 路由)。
- run_
engine_ loop_ stamped - 生产指标入口:保持单一有界队列,在元素内携带真实入队时间戳。
- run_
engine_ loop_ with_ transports - 带 transport 路由表的事件泵入口(A1)。
- run_
engine_ loop_ with_ transports_ and_ trace - 显式注入 trace hooks 的 native composition-root 入口;旧入口保持真 no-op。
- run_
engine_ loop_ with_ transports_ and_ trace_ stamped
Type Aliases§
- Transport
Table - TransportId → 实际 WS 连接 的路由表(native 特化:值为
NativeTransport)。