Getting all emissions as iterable - blockingIterable operator

So, we fetched the first emitted item, we fetched the last emitted item, but what if we want all the items emitted for testing? The blockingIterable operator gets you with the same. The blockingIterable operator works in an interesting way, it passes an emission to the Iterable, then the Iterable will keep blocking the iterating thread until the next emission is available. This operator queues up unconsumed values until the Iterator can consume them, and this can cause OutOfMemory exceptions.

So following is an example, where we are obtaining the complete list and then we are checking if the emissions were sorted by converting the returned Iterable to List and checking equality ...

Get Reactive Programming in Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.