反压


🌐 Backpressure

拉模式流有自然的背压——消费者控制速度,因此源的数据读取不会超过消费者的处理能力。推模式流需要显式背压,因为生产者和消费者独立运行。push()broadcast()share() 上的 highWaterMarkbackpressure 选项控制这个机制的工作方式。

🌐 Pull streams have natural backpressure -- the consumer drives the pace, so the source is never read faster than the consumer can process. Push streams need explicit backpressure because the producer and consumer run independently. The highWaterMark and backpressure options on push(), broadcast(), and share() control how this works.