Skip to main content

run_engine_loop

Function run_engine_loop 

Source
pub async fn run_engine_loop(
    shell: ExecutionShell,
    tick_rx: Receiver<Tick>,
    tick_tx: Sender<Tick>,
    config: EngineConfig,
    shutdown_rx: Receiver<()>,
)
Expand description

运行 ExecutionShell 的 tokio 事件泵(native 入口,无 transport 路由)。

无 transport 的兼容入口:Send 表为空 → Effect::Send 落 warn(回退既有行为)。

§使用方式

ⓘ
let (tick_tx, tick_rx) = mpsc::channel::<Tick>(256);
let (shutdown_tx, shutdown_rx) = tokio::sync::oneshot::channel::<()>();
let config = EngineConfig {
    storage,
    http,
    uploader: helix_driver_host::SharedFileUploader::default(),
    event_sink,
    metrics: std::sync::Arc::new(helix_driver_host::NoopMetricSink),
    max_http_inflight: 8,
};
tokio::spawn(run_engine_loop(shell, tick_rx, tick_tx.clone(), config, shutdown_rx));

§Shutdown 语义

shutdown_tx.send(()) 后进入 graceful drain,返回 = 全部已接收 Persist + 必达 Http 已落地。