In order to consume from an infinite stream of data, let's review the approaches discussed in Chapter 6, Surveying the Landscape.
Futures and promises only offer a one-time asynchronous task and are not suitable in this case. Also, we need some kind of list into which a data producer can insert ticks and analytics data. A consumer of this data would then be able to asynchronously take from the list. This is what a queue provides conceptually.
clojure.lang.PersistentQueue/EMPTY option is nonblocking. So, if there's no data in a queue, the consumer would have to continuously ask for data until it arrives (known as
polling). This is not quite what we want. Ideally, the consumer should wait (or block) until the data ...