Created
November 24, 2014 21:41
-
-
Save ztellman/47672ba13867d71e18c8 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
(require | |
'[clojure.string as str] | |
'[manifold.stream :as s] | |
'[byte-streams :as bs]) | |
;; approach #1 | |
(defn handler [s _] | |
(s/connect | |
(s/map #(str/upper-case (bs/to-string %))) | |
s)) | |
;; approach #2 | |
(defn handler [s _] | |
(s/consume s | |
#(s/put! s (str/upper-case (bs/to-string %))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment