Below you will find pages that utilize the taxonomy term “RxJS”
Beware of Backpressure
One of my junior dev was frustrated today. He was supposed to read from a file stream with NodeJS, piping that into the database. However, he got errors thrown everywhere when dealing with larger files. I helped him identified the problem. He had been dumping async calls (the database insertion) faster than the call could be handled. I remotely remember I run into a similar issue years ago when I wrote a web scraper in NodeJS.
Id Based Throttling
RxJS is bonkers! Imagine you have an unbounded stream of events. Each has a unique id. Now you want to throttle the stream based on id, ie. each id should not appear more often than X minutes. With RxJS: // Throttle each id in one minute. fromEvent(emitter, 'tick').pipe( groupBy((e: Event) => e.getId()), flatMap(group => group.pipe(throttleTime(60 * 1000))), ).subscribe( //Do your stuff ); Without RxJS: Too much to write.
Beauty of Lazy Execution
I have done some quick’n’dirty bid data processing with Apache Beam in past weeks. As someone who try to stay away from JVM, I am not a big data expert at all. However the working with apache beam is a blast (Using JAVA!). The lazy execution style feels right a home. I love wiring a various component into a topology, and only start processing when data arrives. I once heard a Haskell fan said that she thought lazy execution was what set Haskell apart from other programing languages.