Back pressure handling with operator and subject #6763
Replies: 1 comment 1 reply
-
I'm not sure I understand what are you solving here - As far as I understood, back pressure is something that some operators on RxJS may have, so you need to be careful when using them. The majority of the operators will never have backpressure (e.g.
I think your It's just... too much? Why not break it down in separate steps and use existing conventions? queue$ = source$.pipe(
bufferTime(cooldownPeriod),
tap(arr => {
if (maxValue && arr.length > maxValue) {
throw new Error("buffer has exceeded the maximum allowable size");
}
}),
map(arr => arr.slice(0, size))
) Isn't this chain equivalent to your |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know that handling back pressure has been a recurring topic here with many issues opened and closed on the matter, and yet for all the discussion, I haven't been able to find a solid implementation anywhere, even unofficially. That's why I'm starting this discussion, not because I expect any of the maintainers to change their mind on the topic, (it would be nice, but I understand their reasoning), but to provide a reasonable solution I recently had to implement for a project, get feedback on it, and to begin a discussion around the best way to handle back pressure in RxJS in lieu of an official operator or Observer type.
Beta Was this translation helpful? Give feedback.
All reactions