19 lines
638 B
Markdown
19 lines
638 B
Markdown
# NapCat
|
|
将回应抽象为event模型
|
|
将请求抽象为request模型
|
|
|
|
优先级发送流程
|
|
sequenceDiagram
|
|
participant Client
|
|
participant PriorityQueue
|
|
participant PendingResponses
|
|
participant Server
|
|
|
|
Client->>PriorityQueue: sendRequest(高优先级)
|
|
Client->>PriorityQueue: sendRequest(低优先级)
|
|
PriorityQueue->>Server: 先发送高优先级请求
|
|
Server->>PendingResponses: 返回响应1
|
|
PendingResponses->>Client: 解除高优先级请求的await
|
|
PriorityQueue->>Server: 发送低优先级请求
|
|
Server->>PendingResponses: 返回响应2
|
|
PendingResponses->>Client: 解除低优先级请求的await |