Created
September 12, 2014 16:42
-
-
Save joshrotenberg/86855c18a76010d015a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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