Table of Contents

Class CellContainerRuntime

Namespace
KernLab.Cell.Runtime
Assembly
KernLab.Cell.Runtime.dll

容器宿主循环(C303——进程画像:引导→自报端点→握手三步→Ready→循环→drain→退出)。 容器侧帧收发泵与 socket 载体自足(D2 两侧互不引用——线材与编解码取自 Contracts)。

public sealed class CellContainerRuntime : IDisposable
Inheritance
CellContainerRuntime
Implements
Inherited Members

Methods

Dispose()

释放泵资源(RunAsync finally 已调——CA1001 双保险)。

public void Dispose()

RunAsync(CellBootArgs, TextWriter?, TextWriter?, CellRuntimeOptions?, CancellationToken)

运行容器至 drain/退出。返回进程退出码(0=正常终态;11=运行期致命,§8)。 嵌入口(§13——消费侧自有 exe 壳):stdout/stderr 可注入,ParentPid 非空即启用零孤儿看门狗(CellOrphanWatch 单一实现——CLI 与嵌入壳同路径), 父死按 §6.1 以退出码 0 自杀。

public static Task<int> RunAsync(CellBootArgs args, TextWriter? stdout = null, TextWriter? stderr = null, CellRuntimeOptions? options = null, CancellationToken lifetime = default)

Parameters

args CellBootArgs

引导参数(CLI 解析或编程构造——同一契约面)。

stdout TextWriter

stdout 注入流(端点自报唯一合法输出——缺省控制台)。

stderr TextWriter

stderr 注入流(运行期致命取证——缺省控制台)。

options CellRuntimeOptions

运行时选项(契约单源集注入等——缺省 null=全缺省面)。

lifetime CancellationToken

宿主取消(父进程退出路径——取消即正常终态)。

Returns

Task<int>