refactor: remove setImmediate (#10856)

This commit is contained in:
Alex Rudenko 2023-09-07 10:44:33 +02:00 committed by GitHub
parent 72175906a5
commit 7f9c14c745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,11 +51,9 @@ export class NodeWebSocketTransport implements ConnectionTransport {
constructor(ws: NodeWebSocket) {
this.#ws = ws;
this.#ws.addEventListener('message', event => {
setImmediate(() => {
if (this.onmessage) {
this.onmessage.call(null, event.data);
}
});
if (this.onmessage) {
this.onmessage.call(null, event.data);
}
});
this.#ws.addEventListener('close', () => {
if (this.onclose) {