By using an example we are familiar with, we are able to focus on the differences between all of the approaches we have discussed so far, without getting sidetracked with new, specific domain rules.
Before we dive into the implementation, let's quickly get an overview of how our solution should work.
Just as in our previous implementations, we have a service from which we can query share prices. Where our approach differs, however, is a direct consequence of how core.async channels work.
On a given schedule, we would like to write the current price to a core.async channel. This might appear as follows:

This process will continuously put prices in the out channel. We need to do two things with each price: display it and display the calculated sliding window. Since we like our functions to be decoupled, we will use two...