Skip to content

Instantly share code, notes, and snippets.

@joshrotenberg
Created September 12, 2014 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshrotenberg/86855c18a76010d015a6 to your computer and use it in GitHub Desktop.
Save joshrotenberg/86855c18a76010d015a6 to your computer and use it in GitHub Desktop.
(ns immutant.init
(:require [immutant.messaging :as msg]
[immutant.pipeline :as pl]
[clojure.tools.logging :as log]))
(defn add-two [m]
(log/info "add-two processing" m)
(+ 2 m))
(defn times-three [m]
(log/info "times-three processing" m)
(* 3 m))
(defonce test-pipeline
(pl/pipeline "test"
add-two
times-three))
(def t "/topic/test")
(msg/start t)
(msg/listen t #(log/info "got" %))
(msg/listen t #(log/spyf :info "processed: %d" (deref (test-pipeline %))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment