O'Reilly logo

Mastering Reactive JavaScript by Erich de Souza Oliveira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dealing with backpressure

Backpressure happens every time you receive data faster than you are able to process for a given time.

Before even starting to code your solution for back pressure you must decide if you are willing to spend memory or lose data.

When you can lose data you can use a lossy strategy; the advantage of this strategy is it has a low consumption of memory, and lets you mitigate the problem using constant memory. The lossy operators that we learned are as follows:

  • throttle()
  • sample()
  • debounce()
  • pausable()

If you cannot lose data, you can use memory to store data while processing it; the strategy you will use to deal with backpressure is the loss-less strategy. We learned the following operators to loss-less operators to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required