Bounded version of AsyncPipe
Summary: Some use-cases of AsyncPipe may want to backpressure writers in the case that readers start to slow down. Without backpressure, the queue (and pending work) can essentially grow without bound, leading to OOMs or starvation of other resources. This implements a bounded channel primitive by layering a semaphore in front of an existing AsyncPipe. It inherits similar cancellation behavior, though pending writes must be canceled in the case that the read end is destroyed. Reviewed By: iahs Differential Revision: D26260278 fbshipit-source-id: a936cf021023b31a6db868e27e9855480a1dc405
Showing
Please register or sign in to comment