Skip to content

Instantly share code, notes, and snippets.

@maxcountryman
Last active December 17, 2015 17:39
Show Gist options
  • Save maxcountryman/5647594 to your computer and use it in GitHub Desktop.
Save maxcountryman/5647594 to your computer and use it in GitHub Desktop.
Playing around with agents. Fun!
(require '[clojure.java.io :as io])
(import [java.net Socket])
(def irc (agent {:socket (Socket. "irc.strangeloop.io" 7000)}))
(send irc (fn [{:keys [socket]}]
(doseq [line (line-seq (io/reader socket))]
(println line))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment