feat: a framework of active (reverse, 反向) websocket

This commit is contained in:
Wesley F. Young committed 2024-08-10 15:13:26 +08:00
1 parent 7116d63f50
commit 10cd6c1b9f
2 files changed
+76

No files matched your search

+2
View File
@@ -29,6 +29,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
}
wsClient.on('message', (message) => {
// TODO: extract action name and payload from the message, then call the corresponding action.
// TODO: consider using a utility function
});
wsClient.once('close', () => {
this.wsClientsMutex.runExclusive(async () => {
@@ -53,6 +54,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
this.wsClients.forEach((wsClient) => {
// wsClient.send(JSON.stringify(event));
// TODO: wrap the event, and send the wrapped to the client.
// TODO: consider using a utility function
});
});
}