Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (12 sloc) 0.481 kB
(ns ruminate.core)
(defn add-ruminant [source name init reduce-fn]
(vary-meta source assoc-in
[::ruminants name] {:agent (agent init)
:reduce-fn reduce-fn}))
(defn ruminant [source name]
(let [agent (get-in (meta source) [::ruminants name :agent])]
(await agent)
@agent))
(defn ruminate [source value]
(doseq [[name ruminant] (::ruminants (meta source))]
(send (:agent ruminant) (:reduce-fn ruminant) value)))
Jump to Line
Something went wrong with that request. Please try again.