O'Reilly logo

Clojure Programming Cookbook by Nicolas Modrzyk, Makoto Hashimoto

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bridging core.async

Clojure's core.async is one of those Clojure features that makes you love asynchronous programming. While not included in Clojure core, it is straight and easy to put into use and makes Clojure's STM a breeze to use. Unfortunately, most of the examples that can be found on core.async make it a bit hard to see how to connect it and plug things together with the rest of your current code and other frameworks.

This recipe wants to close the gap and help you bring out more core.async code out there.

Getting ready

This recipe is largely based on core.async, but we will use a few other libraries. Here's a sample dependencies section for your project.clj file:

 :dependencies [ [org.clojure/clojure "1.8.0"] [org.clojure/core.async "0.2.374"] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required