about auto pause when using pipeToRouter

Hello,

When I use pipeToRouter to create worker to worker stream.

If I pause source producer , still need to pause pipedConsumer manually?

I checked source code there:

// Pipe events from the pipe Consumer to the pipe Producer.
pipeConsumer!.observer.on('close', () => pipeProducer!.close());
pipeConsumer!.observer.on('pause', () => pipeProducer!.pause());
pipeConsumer!.observer.on('resume', () => pipeProducer!.resume());

you have made the auto pause between pipeConsumer and pipeProducer

but why there is no such code :

producer.on(‘pause’ , ()=> pipeConsumer.pause())
producer.on(‘resume’ , ()=> pipeConsumer.resume())

My question is:

Is that because pipeConsumer does not need to pause when source producer pause?
Or there is some special scenario need to manually pause() pipeConsumer?

Really thanks for your response

Because those events are already handled internally by mediasoup with this:

pipeConsumer!.observer.on('pause', () => pipeProducer!.pause());
pipeConsumer!.observer.on('resume', () => pipeProducer!.resume());

Ref: mediasoup :: API