Chapter 6. Sharing by Communicating
Some problems, like those involving waiting on I/O or randomly waiting for user input, tend to be very well addressed using asynchronous programming. Asynchronous programming is a paradigm where algorithms are devised in terms of independent mini-processes that are executed concurrently and which are not synchronized using any form of locking. Those processes do share resources but are instead able to communicate through some conveyor-belt like structures called channels. In this chapter, we are going to see asynchronous programming in action using core.async
, an implementation of this paradigm in Clojure, while developing the following recipes:
- Building a tiny web crawler
- Designing an HTML5 game
- Designing an online taxi-booking engine