Skip to content

Commit c9b66a9

Browse files
committed
cosmetic and fix in Channel.ts notify()
1 parent 03aba3c commit c9b66a9

17 files changed

+19
-33
lines changed

node/src/Channel.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,21 +173,21 @@ export class Channel extends EnhancedEventEmitter {
173173
}
174174
});
175175

176-
this.#consumerSocket.on('end', () =>
177-
logger.debug('Consumer Channel ended by the worker process')
178-
);
176+
this.#consumerSocket.on('end', () => {
177+
logger.debug('Consumer Channel ended by the worker process');
178+
});
179179

180-
this.#consumerSocket.on('error', error =>
181-
logger.error(`Consumer Channel error: ${error}`)
182-
);
180+
this.#consumerSocket.on('error', error => {
181+
logger.error(`Consumer Channel error: ${error}`);
182+
});
183183

184-
this.#producerSocket.on('end', () =>
185-
logger.debug('Producer Channel ended by the worker process')
186-
);
184+
this.#producerSocket.on('end', () => {
185+
logger.debug('Producer Channel ended by the worker process');
186+
});
187187

188-
this.#producerSocket.on('error', error =>
189-
logger.error(`Producer Channel error: ${error}`)
190-
);
188+
this.#producerSocket.on('error', error => {
189+
logger.error(`Producer Channel error: ${error}`);
190+
});
191191
}
192192

193193
/**
@@ -244,7 +244,7 @@ export class Channel extends EnhancedEventEmitter {
244244
);
245245
}
246246

247-
const handlerIdOffset = this.#bufferBuilder.createString(handlerId);
247+
const handlerIdOffset = this.#bufferBuilder.createString(handlerId ?? '');
248248

249249
let notificationOffset: number;
250250

@@ -283,14 +283,16 @@ export class Channel extends EnhancedEventEmitter {
283283
this.#bufferBuilder.clear();
284284

285285
if (buffer.byteLength > MESSAGE_MAX_LEN) {
286-
throw new Error(`notification too big [event:${Event[event]}]`);
286+
logger.error(`notify() | notification too big [event:${Event[event]}]`);
287+
288+
return;
287289
}
288290

289291
try {
290292
// This may throw if closed or remote side ended.
291293
this.#producerSocket.write(buffer, 'binary');
292294
} catch (error) {
293-
logger.warn(`notify() | sending notification failed: ${error}`);
295+
logger.error(`notify() | sending notification failed: ${error}`);
294296

295297
return;
296298
}
@@ -317,7 +319,6 @@ export class Channel extends EnhancedEventEmitter {
317319
}
318320

319321
const id = this.#nextId;
320-
321322
const handlerIdOffset = this.#bufferBuilder.createString(handlerId ?? '');
322323

323324
let requestOffset: number;

rust/src/worker/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ where
7878
argc,
7979
argv.as_ptr(),
8080
version.as_ptr(),
81-
0,
82-
0,
81+
/*consumerChannelFd*/ 0,
82+
/*producerChannelFd*/ 0,
8383
channel_read_fn,
8484
channel_read_ctx,
8585
channel_write_fn,

worker/fbs/activeSpeakerObserver.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ table ActiveSpeakerObserverOptions {
99
table DominantSpeakerNotification {
1010
producer_id: string (required);
1111
}
12-

worker/fbs/audioLevelObserver.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ table Volume {
1616
table VolumesNotification {
1717
volumes: [Volume] (required);
1818
}
19-

worker/fbs/common.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ enum TraceDirection: uint8 {
3030
DIRECTION_IN = 0,
3131
DIRECTION_OUT
3232
}
33-

worker/fbs/consumer.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,3 @@ table TraceNotification {
122122
direction: FBS.Common.TraceDirection;
123123
info: TraceInfo;
124124
}
125-

worker/fbs/dataConsumer.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,3 @@ table MessageNotification {
7373
ppid: uint32;
7474
data: [uint8] (required);
7575
}
76-

worker/fbs/dataProducer.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ table SendNotification {
3131
subchannels: [uint16];
3232
required_subchannel: uint16 = null;
3333
}
34-

worker/fbs/directTransport.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ table GetStatsResponse {
1919
table RtcpNotification {
2020
data: [uint8] (required);
2121
}
22-

worker/fbs/liburing.fbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ table Dump {
55
sqe_miss_count: uint64;
66
user_data_miss_count: uint64;
77
}
8-

0 commit comments

Comments
 (0)