Knowing Java and your way around Java's threading APIs gives you a great advantage, since Clojure relies on the tools that you already know.
Here, you'll see how to use threads and you can extend everything you see here to execute other services.
Before going any further, let's create a new project that we'll use as a sandbox for all of our tests.
Create it, as shown in the following screenshot:
Modify the clojure-concurrency.core
namespace, so that it looks similar to the following code snippet:
(ns clojure-concurrency.core) (defn start-thread [func] (.start (Thread. func)))
It's easy to understand what's happening here. We are creating a thread with our function and then starting it; so that we can use it in the REPL, as follows: