The last operator to buffer data we will see is the bufferWithTimeOrCount()operator. In the last two sessions, we learned about the bufferWithCount() operator which lets us put a limit on the size of the array, and the bufferWithTime() operator which lets us put a limit on the time to fill the buffer. Sometimes we might want to put a maximum on both.
The bufferWithTimeOrCount() method has the following signature:
The two first parameter are mandatory and the last is optional:
- time: This is the time in milliseconds to buffer the data, before propagating it
- count: This is the maximum size of the buffer
- scheduler: This is used to propagate the data ...