Skip to main content

Module engine_loop

Module engine_loop 

Source
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§

EngineConfig
事件泵配置(native 具体 ports 聚合)。

Functions§

rows_from_reply_bytes
Decode rows_to_reply_bytes output 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§

TransportTable
TransportId → 实际 WS 连接 的路由表(native 特化:值为 NativeTransport)。