Replace Probe with Agent across node runtime, Fleet contracts, backend state, API and storage. Report incoming sessions and outgoing link health through each Agent uplink, and retain directed link controls and retry. Update protocol fixtures and end-to-end coverage for the unified model; accept requested cancellation during the Fleet timeout test cleanup.
46 lines
2.5 KiB
C#
46 lines
2.5 KiB
C#
using Fleet.Rpc;
|
|
|
|
namespace MoShiro.Protocol;
|
|
|
|
/// <summary>
|
|
/// 所有方法和二进制通道的方向声明,单一真源(框架的 <c>fleet.*</c> 见 <see cref="FleetMethodTable"/>)。
|
|
/// 新增一个方法:在 <see cref="MoShiroMethods"/> 里加名字和参数,在这里加一行声明,再在对应一侧注册处理函数;
|
|
/// 声明了但没人处理、或者处理了但没声明,都会被测试和启动时的检查发现。
|
|
/// 同一个方法名只有一个发起方;节点面是服务端和节点,对等面是拨号方和监听方。所有节点是同一种角色:
|
|
/// 能做什么由节点的配置(是否监听)和 Backend 下发的期望状态决定,声明表不区分节点类型。
|
|
/// </summary>
|
|
public static class MoShiroMethodTable
|
|
{
|
|
public static readonly MethodTable Table = MethodTable.Combine(
|
|
FleetMethodTable.Table,
|
|
new MethodTable(
|
|
[
|
|
// 节点面:Backend → 节点
|
|
MethodSpec.Request(MoShiroMethods.TestRun, RpcSide.Server),
|
|
MethodSpec.Request(MoShiroMethods.TestCancel, RpcSide.Server),
|
|
MethodSpec.Request(MoShiroMethods.DialerDisconnect, RpcSide.Server),
|
|
MethodSpec.Notification(MoShiroMethods.LinkRetry, RpcSide.Server),
|
|
MethodSpec.Notification(MoShiroMethods.UpdateOffer, RpcSide.Server),
|
|
MethodSpec.Notification(MoShiroMethods.UpdateApply, RpcSide.Server),
|
|
MethodSpec.Notification(MoShiroMethods.Schedule, RpcSide.Server),
|
|
|
|
// 节点面:节点 → Backend
|
|
MethodSpec.Notification(MoShiroMethods.TestStatus, RpcSide.Node),
|
|
MethodSpec.Notification(MoShiroMethods.Event, RpcSide.Node),
|
|
MethodSpec.Notification(MoShiroMethods.Host, RpcSide.Node),
|
|
|
|
// 对等面:拨号方 → 监听方
|
|
MethodSpec.Request(MoShiroMethods.Clock, RpcSide.Dialer),
|
|
|
|
// 对等面:监听方 → 拨号方
|
|
MethodSpec.Request(MoShiroMethods.TestPhase, RpcSide.Listener),
|
|
MethodSpec.Request(MoShiroMethods.TestPhaseEnd, RpcSide.Listener),
|
|
MethodSpec.Notification(MoShiroMethods.TestAbort, RpcSide.Listener),
|
|
],
|
|
[
|
|
// 原始块:节点往 Backend 发;列块:拨号方经对等会话发给监听方
|
|
new ChannelSpec(MoShiroChannels.RawChunk, RpcSide.Node),
|
|
new ChannelSpec(MoShiroChannels.ColumnBlock, RpcSide.Dialer),
|
|
]));
|
|
}
|