Table of Contents

Class CellCorrelationRegistry

Namespace
KernLab.Cell
Assembly
KernLab.Cell.dll

关联域(总体设计 §3.3——callId/requestId → TaskCompletionSource 映射):

★ 有界:容量满=背压信号——TryRegister(ulong, TimeSpan, out CellPendingCall) false 拒绝新调用, 不静默挤掉在途关联(诚实边界)。

★ 注册即超时兜底:每条在途注册即挂超时——对端失联/回执丢失不会让调用方永久悬挂。

public sealed class CellCorrelationRegistry
Inheritance
CellCorrelationRegistry
Inherited Members

Constructors

CellCorrelationRegistry(int)

构造。

public CellCorrelationRegistry(int capacity)

Parameters

capacity int

在途上限(背压线——拒绝新调用而非挤掉在途)。

Properties

Capacity

在途上限。

public int Capacity { get; }

Property Value

int

Count

当前在途数(§9 关联域水位观测口)。

public int Count { get; }

Property Value

int

Watermark

在途峰值(§9——单调只升)。

public long Watermark { get; }

Property Value

long

Methods

FaultAll(ushort)

终态灌入:全部在途以指定错误码失败(容器 Faulted——诚实边界:结果未知不伪造,D6)。返回灌入条数。

public int FaultAll(ushort errorCode)

Parameters

errorCode ushort

Returns

int

TryCancel(ulong)

本地取消(Cancel 帧/调用方取消——容器侧尽力,宿主任务以取消收场)。false=不在册。

public bool TryCancel(ulong key)

Parameters

key ulong

Returns

bool

TryComplete(ulong, CellFrame)

回执到达:完成在途调用(回执帧——Result/CallbackResult)。false=不在册(已超时/已取消——调用方计数)。

public bool TryComplete(ulong key, CellFrame frame)

Parameters

key ulong
frame CellFrame

Returns

bool

TryRegister(ulong, TimeSpan, out CellPendingCall)

注册在途关联(注册即挂超时兜底)。false=容量满(CorrelationOverflow——背压, 拒绝新调用)或键重复(发送侧 bug——callId 单调性被破)。

public bool TryRegister(ulong key, TimeSpan timeout, out CellPendingCall pending)

Parameters

key ulong
timeout TimeSpan
pending CellPendingCall

Returns

bool