You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't make sense to send requests in some cases where a response is not expected. For example:
pause/resume() methods in Producer, Consumer, DataProducer and DataConsumer.
Imagine that the app calls consumer.pause(). Imagine that just before the "pause" request reaches the worker, the producer was closed and hence the consumer is already closed/freed in the worker, although the "producerclose" notification didn't reach yet Node land.
In v3 this means that consumer.pause() will throw (because the consumer is closed), and this will force the user to write . catch()` etc.
In v4, consumer.pause() should send a notification to the worker and immediately set the paused flag to true in Node/Rust layers.
I think the benefit of request/response is that we get an acknowledgement back. If we are fine to not wait for acknowledgement then we can switch to notifications indeed.
Specially in flatbuffers branch (so I assume in v4 too) we use a single channel to communicate Node and worker, and it's a UnixSocket in stream mode, meaning that message order and delivery is guaranteed. So once you send a "data producer pause" notification you know that the next time you call dataProducer.send() the C++ DataProducer will be pause when that message reaches the worker. So no need for worker acknowledge here. Note: this is not true for RTP or DataChannel packets received from the network but it doesn't matter IMHO.
It doesn't make sense to send requests in some cases where a response is not expected. For example:
pause/resume()
methods inProducer
,Consumer
,DataProducer
andDataConsumer
.Imagine that the app calls
consumer.pause()
. Imagine that just before the "pause" request reaches the worker, the producer was closed and hence the consumer is already closed/freed in the worker, although the "producerclose" notification didn't reach yet Node land.consumer.pause()
will throw (because the consumer is closed), and this will force the user to write . catch()` etc.consumer.pause()
should send a notification to the worker and immediately set thepaused
flag totrue
in Node/Rust layers.The text was updated successfully, but these errors were encountered: