Skip to content

Instantly share code, notes, and snippets.

View kotarak's full-sized avatar

Meikel Brandmeyer kotarak

View GitHub Profile
@kotarak
kotarak / mutabots.clj
Last active August 29, 2015 14:07 — forked from cgrand/mutabots.clj
(ns mutabots
"Reimplementation of transducers, in terms of processing functions instead
of reducing functions.
tl;dr: reducing-fn based transducers are a special case, influenced by reducers,
of processing-fn based transducers.
In Clojure 1.7.0-alpha2, transducers are expressed in terms of the existing
concept of reducing functions.
To sum it up, a transducer has currently the signature :
@kotarak
kotarak / meikel-q.clj
Last active January 3, 2016 13:39 — forked from cgrand/meikel-q.clj
(defn queue-process-uncontrolled
[input output stats]
(async/go
(loop [q clojure.lang.PersistentQueue/EMPTY]
(let [[val-to-q ch] (async/alts!
(if-let [v (peek q)]
[input [output v]]
[input]))]
(swap! stats update-stats-as-you-see-fit q)
(cond