Book Image

Hands-On Reactive Programming with Clojure - Second Edition

By : Konrad Szydlo, Leonardo Borges
Book Image

Hands-On Reactive Programming with Clojure - Second Edition

By: Konrad Szydlo, Leonardo Borges

Overview of this book

Reactive Programming is central to many concurrent systems, and can help make the process of developing highly concurrent, event-driven, and asynchronous applications simpler and less error-prone. This book will allow you to explore Reactive Programming in Clojure 1.9 and help you get to grips with some of its new features such as transducers, reader conditionals, additional string functions, direct linking, and socket servers. Hands-On Reactive Programming with Clojure starts by introducing you to Functional Reactive Programming (FRP) and its formulations, as well as showing you how it inspired Compositional Event Systems (CES). It then guides you in understanding Reactive Programming as well as learning how to develop your ability to work with time-varying values thanks to examples of reactive applications implemented in different frameworks. You'll also gain insight into some interesting Reactive design patterns such as the simple component, circuit breaker, request-response, and multiple-master replication. Finally, the book introduces microservices-based architecture in Clojure and closes with examples of unit testing frameworks. By the end of the book, you will have gained all the knowledge you need to create applications using different Reactive Programming approaches.
Table of Contents (15 chapters)

Summary

By now, I hope I have proved to you that you can write reactive applications using core.async. It's an extremely powerful and flexible concurrency model with a rich API. If you can design your solution in terms of queues, it is more than likely that core.async is the tool you want to reach for.

This version of the stock market application is shorter and simpler than the version that uses only the standard Java API we developed earlier in this book in Chapter 3, Asynchronous Programming and Networking. For instance, we didn't have to worry about thread pools. On the other hand, it feels like it is a little more complex than the version we implemented using Reactive Extensions in Chapter 3, Asynchronous Programming and Networking.

This is because core.async operates at a lower level of abstraction when compared to other frameworks. This became especially obvious...