This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-03
Channels
- # aws (27)
- # beginners (64)
- # boot (14)
- # calva (10)
- # cider (36)
- # cljs-dev (13)
- # cljsrn (79)
- # clojure (58)
- # clojure-berlin (8)
- # clojure-france (1)
- # clojure-italy (18)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (29)
- # clojurescript (55)
- # core-async (20)
- # cursive (5)
- # datomic (105)
- # emacs (17)
- # figwheel-main (13)
- # fulcro (20)
- # graphql (4)
- # hoplon (1)
- # hyperfiddle (2)
- # jobs (7)
- # jobs-discuss (110)
- # off-topic (23)
- # pathom (1)
- # perun (2)
- # re-frame (87)
- # reitit (2)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (118)
- # vim (11)
Is there a reason why tap
doesn't have a transducer form? Is there a better way to link a mult to another channel via a transducer than through an intermediate channel?
back up and state what problem you’re trying to solve
tap is like prn - it is hard for me to meaningful say that either should have a “transducer form” or even what that means
Well, what I want is that I have a channel, which I want to distribute to different sinks, for which I currently use a mult and a few taps to the sink channels. That works quite well. Now I want to subject each of those connections to a different transducer for each sink, and I found no straightforward way to do that.
What I meant by transducer form was something similar to pipeline, which as far as I know doesn't work on mults. I actually thought that pipe
had a call signature with a transducer arg too, but apparently that's not the case
No, it's a valid question, but I can not, because they are fed from different sources. Transforming everything to a common format is actually one of the reasons I need the transducers
Not sure I understand the issue, tap
does not take a transducer, but the channel you give it does...
oh, hang on - you are talking about tap in core.async, not tap>, the new function in Clojure 1.10
so completely ignore what I said before :)
but, what fmjrey said - tap
takes a channel, which can have a transducer applied to it
Ok, so there is no straightforward solution, I have the sink channels provided to me and can not apply transducers to them afterwards
you could connect new ones with pipe
what you said about using pipe
would work too, you supply your own transducer to the channel at the end of the pipe you control - that's where the "transducer arg" analog would be in your q above
ok, so I create a new channel with a transducer, tap
into that, and pipe
from there to the sink, did I understand that correctly?
if that works for you, yes. it sounded just now like you weren't in control of the sink channels that got supplied to you, so that's the reason for using an additional channel that you do control, supplying a transducer to it when you create it, and hooking it/them up to the sink channel/s via pipe
.