A Real-World Example
While it’s great to talk about the different interop cases and learn how to eke out some additional performance using Java’s primitive forms, you still need to have some practical, hands-on knowledge. In this example, we will be building an application to test the availability of websites. The goal here is to check to see whether the website returns an HTTP 200 OK response. If anything other than our expected response is received, it should be marked as unavailable.
Again, we will use the Leiningen build tool. Refer to Clojure Coding Quick Start if you don’t have Leiningen installed already. Let’s start by creating a new project:
lein new pinger |
Open your project.clj file and modify the contents to match what we ...
Get Programming Clojure, 2nd Edition 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.