Skip to content

Instantly share code, notes, and snippets.

@ztellman
Created November 24, 2014 21:41
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 ztellman/47672ba13867d71e18c8 to your computer and use it in GitHub Desktop.
Save ztellman/47672ba13867d71e18c8 to your computer and use it in GitHub Desktop.
(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