Designing an online taxi-booking engine

Asynchronous programming is a very good choice for making independent processes collaborate, relieving the designer from the burden of maintaining a global state for all of the entities at stake. We are going to showcase this in a recipe, in which we will simulate an online taxi-booking engine.

In the system we are longing to build, no global state will be maintained. Instead, we are going to fire as many processes as we have taxis, and a couple more to ensure that the collaboration between them occurs properly. Finally, customer requests will land in our system from the outer world via channels.

The rules our taxi-booking engine obeys will be kept as simple as possible a given taxi, whose status is initially ...

Get Clojure Data Structures and Algorithms Cookbook 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.