Files
vRp.CD2g_test/.github/sequence-diagram/server-gdi.text
2023-12-25 11:45:58 +08:00

38 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
title This is a title
participantspacing equal
#participantspacing gives manual control of spacing between participants, equal: equal distance between all participants, number i.e. 20.5: minimum space
actor Client#lightgreen
#supported participant types: participant, actor, boundary, control, entity, database
participantgroup #lightgreen Minotaur Server
participant Server
participant Shunt
abox left of Shunt: System 消息将全局单线程执行Shunt 消息将会\n在连接当前所在分流渠道内执行。相同分流渠道的\n消息将串行处理不同分流渠道消息并行处理。\n\n连接可根据业务场景灵活的通过 srv.UseShunt 来\n切换当前所处的分流渠道
abox left of Shunt: 异步消息\n\n(SystemMessage) srv.PushAsyncMessage\n(ShuntMessage) srv.PushShuntAsyncMessage\n(SystemMessage) srv.PushUniqueAsyncMessage\n(ShuntMessage) srv.PushUniqueShuntAsyncMessage\n\n Unique 消息将会在上一个相同消息未执行完毕\n的情况下忽略后续消息
end
Client->Server:通过 WebSocket、TCP、UDP、KCP 等协议与服务器建立连接
loop Write Loop
Server ->Client:写入数据包
abox left of Server: 数据包将被写入对应连接的缓冲区内等待发送 ,写入\n缓冲区后逻辑视为处理完毕网络 IO 不会阻塞分流渠道
end
Server -->Shunt: (SystemMessage) OnConnectionOpenedEvent
Shunt --> Shunt: 消息处理
Server -->Shunt: (ShuntMessage) OnConnectionOpenedAfterEvent
Shunt --> Shunt: 消息处理
loop Read Loop
Client->Server:发送数据包
abox right of Client: 数据包将被发送到连接对应分流渠道的缓冲区内
Server -->Shunt: (ShuntMessage) OnConnectionReceivePacketEvent
Shunt --> Shunt: 消息处理
Shunt --> Server: 回复消息
Server --> Server: 写入 Write Loop
end
Client <->Server: 断开或关闭连接
Server -->Shunt: (ShuntMessage) OnConnectionClosedEvent
Shunt --> Shunt: 消息处理