Malcolm Sparks
2015-04-25 18:59:43 UTC
I'm just wondering why manifold.deferred contains this logic :-
(utils/when-core-async
(extend-protocol Deferrable
clojure.core.async.impl.channels.ManyToManyChannel
(to-deferred [ch]
(let [d (deferred)]
(a/take! ch
(fn [msg]
(if (instance? Throwable msg)
(error! d msg)
(success! d msg))))
d))))
I find I'm having to wrap a core.async channel in a record in order for it
to return one in a d/chain function. That's OK, but I just wondered what
the rationale of making a core.async channel satisfy Deferrable. Is there
some interaction between d/chain and core.async channels here?
Thanks,
Malcolm
(utils/when-core-async
(extend-protocol Deferrable
clojure.core.async.impl.channels.ManyToManyChannel
(to-deferred [ch]
(let [d (deferred)]
(a/take! ch
(fn [msg]
(if (instance? Throwable msg)
(error! d msg)
(success! d msg))))
d))))
I find I'm having to wrap a core.async channel in a record in order for it
to return one in a d/chain function. That's OK, but I just wondered what
the rationale of making a core.async channel satisfy Deferrable. Is there
some interaction between d/chain and core.async channels here?
Thanks,
Malcolm
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.