(bid bthread)
(bid bthread event)
(name bthread)
(priority bthread)
(reduce f)
(reduce f init)
(reduce f init opts)
Make a bthread from a reducing function.
The function takes the accumulated value and the new event.
The accumulated value is the previous bid, which can have any extra information added to it.
(def bthread
(b/reduce (fn [{:keys [times-called]} _]
(when-not (= times-called 3)
{:request #{:more}
:times-called (inc times-called)}))
{:times-called 0}))
Make a bthread from a reducing function. The function takes the accumulated value and the new event. The accumulated value is the previous bid, which can have any extra information added to it. Example ------- ``` (def bthread (b/reduce (fn [{:keys [times-called]} _] (when-not (= times-called 3) {:request #{:more} :times-called (inc times-called)})) {:times-called 0})) ```
(seq xs)
(seq xs opts)
Make a bthread from a sequence. Items in the sequence must be bthreads. If nil is received, the bthread stops.
Make a bthread from a sequence. Items in the sequence must be bthreads. If nil is received, the bthread stops.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close