This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-11
Channels
- # bangalore-clj (1)
- # beginners (24)
- # boot (134)
- # boulder-clojurians (2)
- # cider (3)
- # cljs-dev (2)
- # cljsjs (44)
- # clojars (9)
- # clojure (60)
- # clojure-greece (2)
- # clojure-quebec (1)
- # clojure-russia (44)
- # clojure-spec (15)
- # clojure-uk (1)
- # clojurescript (37)
- # core-matrix (1)
- # datomic (7)
- # emacs (1)
- # hoplon (154)
- # liberator (3)
- # mount (2)
- # om (20)
- # onyx (2)
- # pedestal (3)
- # planck (12)
- # re-frame (26)
- # reagent (32)
- # uncomplicate (4)
where core.async <?
macro is located?
nevermind, it is a custom one
@jasonjckn not really at runtime, but you can extract this information at compile-time, encode it into your own data structure and emit it into generated javascript code as cljs data
https://github.com/binaryage/cljs-devtools/blob/06870cbc93a8ec0b29a02f64a736bde4f097334e/src/lib/devtools/formatters/markup.cljs#L451 https://github.com/binaryage/cljs-devtools/blob/06870cbc93a8ec0b29a02f64a736bde4f097334e/src/lib/devtools/formatters/markup.clj#L10
how do I organize multiple async operations via core.async with limited concurrency? have 1 buffered channel and multiple readers?
by concurrency I mean multiple go blocks or something like that, not real threads ofc
If I have a function: (def ^:private render-row [label data key] [:p label (:key data) ]) How can I access data dynamically by the name of the key given in parameter "key"?
@artur (get data key)
?
Also, PersistentMaps also implement IFn
so you can do (data key)
as well
can I put value on a channel that is read from another channel? like (>! chan (<! (stat-file item)))
@yury.solovyov yes, inside a go block, you can do any combination of channel ops that will park/yield to/from any channels. Some of the built-in core.async public functions are just wrappers over go/go-loop.
@gtrak thanks
what about my earlier question?
any suggestions?
I'm not sure what kind of answer you're looking for, but in general I write channel-returning functions and compose them with higher-level go-blocks.
if you have multiple channels, your choices of what to do with them might include something like alts or mux or pipeline, or something more manual with a go-block.
A higher-level org-structure might include the 'component' library to wire things up, and an example is detailed here: http://matthiasnehlsen.com/blog/2014/09/24/Building-Systems-in-Clojure-1/
what kind of looping can I use inside go block? can I use doseq
?
@yury.solovyov you should be able to use most of the things, just be careful about inner functions, they are considered a different scope
and yes, you can use doseq
though stats are performed ok
@yury.solovyov pretty sure your problem is in L42 of the gist
into
’s 2nd arg should be a sequence
but you’re just taking 1 item from the channel and passing that
I guess its different into
and I'm using collection into...
@yury.solovyov right so maybe you should probably use the core.async/into
you’re definitely using cljs.core/into
(you should also close the channel whenever doseq
is finished for into
to return)
(<! (into (vector) (<! (map-items-to-stats res))))
needed to extract value from into, cause it is channel too
thanks