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,12 +51,10 @@ export class NodeWebSocketTransport implements ConnectionTransport {
constructor(ws: NodeWebSocket) { constructor(ws: NodeWebSocket) {
this.#ws = ws; this.#ws = ws;
this.#ws.addEventListener('message', event => { this.#ws.addEventListener('message', event => {
setImmediate(() => {
if (this.onmessage) { if (this.onmessage) {
this.onmessage.call(null, event.data); this.onmessage.call(null, event.data);
} }
}); });
});
this.#ws.addEventListener('close', () => { this.#ws.addEventListener('close', () => {
if (this.onclose) { if (this.onclose) {
this.onclose.call(null); this.onclose.call(null);