This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-25
Channels
- # aws (1)
- # bangalore-clj (9)
- # boot (97)
- # capetown (1)
- # cider (4)
- # clara (1)
- # cljs-dev (2)
- # cljsrn (109)
- # clojure (258)
- # clojure-finland (3)
- # clojure-greece (2)
- # clojure-italy (1)
- # clojure-russia (33)
- # clojure-spec (41)
- # clojure-uk (46)
- # clojurescript (57)
- # component (17)
- # core-async (6)
- # datomic (13)
- # devcards (10)
- # dirac (2)
- # euroclojure (1)
- # figwheel (1)
- # funcool (1)
- # hoplon (472)
- # luminus (17)
- # off-topic (1)
- # om (16)
- # onyx (40)
- # pedestal (14)
- # proton (12)
- # re-frame (27)
- # reagent (15)
- # ring-swagger (2)
- # specter (5)
- # testing (4)
- # untangled (258)
- # vim (4)
(ns test
(:require [clojure.core.async :as a]))
(def c (a/chan 1 (mapcat (fn [x] (doall (range 0 x))))))
(a/>!! c 10000)
(println (a/<!! c)) ; where is the giant seq buffered?
I’m wondering how mapcat or other “expanding” transducer functions work with core.async. It appears the channel will happily buffer 10,000 values, but are they buffered efficiently? Does the core.async implementation buffer them in a separate “special” place?
buffers are allowed to buffer extra values created by an expanding transducer
they’re in the buffer
of the channel you created so it’s really up to you where they’re buffered
if this is bad for you, then don’t do that :)