RxJS operator to apply backpressure handling
Prevents overwhelming subscribers by throttling or buffering log emissions. Choose either throttle (emit one log per interval) or buffer (emit arrays).
Backpressure configuration
Operator function that applies backpressure
// Throttle: emit max one log per secondlogs$.pipe( withBackpressure({ throttleMs: 1000 })).subscribe(log => sendToSlack(log)) Copy
// Throttle: emit max one log per secondlogs$.pipe( withBackpressure({ throttleMs: 1000 })).subscribe(log => sendToSlack(log))
// Buffer: emit batches every 5 secondslogs$.pipe( withBackpressure({ bufferMs: 5000 })).subscribe(logs => bulkInsertToDb(logs)) Copy
// Buffer: emit batches every 5 secondslogs$.pipe( withBackpressure({ bufferMs: 5000 })).subscribe(logs => bulkInsertToDb(logs))
RxJS operator to apply backpressure handling
Prevents overwhelming subscribers by throttling or buffering log emissions. Choose either throttle (emit one log per interval) or buffer (emit arrays).