This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-28
Channels
- # ai (1)
- # beginners (190)
- # boot (24)
- # cider (43)
- # cljsjs (3)
- # cljsrn (29)
- # clojars (6)
- # clojure (310)
- # clojure-dev (6)
- # clojure-nl (6)
- # clojure-russia (11)
- # clojure-spec (66)
- # clojure-uk (95)
- # clojurescript (103)
- # clojurewerkz (2)
- # core-async (9)
- # cursive (4)
- # datomic (5)
- # hoplon (163)
- # lein-figwheel (52)
- # off-topic (6)
- # om (6)
- # onyx (42)
- # perun (8)
- # re-frame (16)
- # reagent (10)
- # ring (7)
- # ring-swagger (1)
- # rum (1)
- # slack-help (2)
- # uncomplicate (1)
- # untangled (80)
@tbaldridge Specifically I was referring to the >af must close! the channel before returning. part of pipeline async, so my understanding of how is works is: input-> from chan -> transducer fn (spins off async task and closes to chan [but wouldn't that not give the async task a chance to write out?]) -> to chan
And it feels a bit odd to have af
wait for the async task to finish, write to the chan, and then closes the chan
@royalaid the key thing is that af
can write 0 or more items to the channel. It could just close it and write nothing, or it could write dozens of things. The other key thing is that af
is free to hand that channel out to anything, another library or some other module.
The async part of the name pipeline-async
hints at that. The execution of the af
is considered async. Sure it could do all its calculations during the call to af
but it doesn't have to.
OHHHHHH So the async part of af
can close the channel? Because this whole time I was under the impression that it had to be the very outside af
and could not be nested in any go/thread blocks
@royalaid correct, af
can do whatever it wants with that channel, the pipeline will splice any data it receives from that channel into the output of the pipeline.
Is it possible to create the channel with a transducer which transforms values only when they are taken from the channel? I'm trying to replicate the error example from this post: http://blog.venanti.us/using-transducers-with-core-async-clojurescript/ and so far it looks like the error value is transduced as soon as it's put into channel.