This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-23
Channels
- # admin-announcements (1)
- # announcements (1)
- # beginners (222)
- # boot (210)
- # cider (26)
- # cljs-dev (50)
- # cljsrn (19)
- # clojure (243)
- # clojure-art (12)
- # clojure-finland (1)
- # clojure-poland (43)
- # clojure-russia (46)
- # clojure-sg (13)
- # clojurescript (60)
- # core-async (14)
- # css (11)
- # datomic (9)
- # devcards (9)
- # dirac (2)
- # editors (13)
- # emacs (5)
- # euroclojure (1)
- # events (3)
- # hoplon (76)
- # immutant (10)
- # job (1)
- # jobs (2)
- # keechma (1)
- # ldnclj (33)
- # lein-figwheel (1)
- # leiningen (20)
- # luminus (26)
- # mount (31)
- # om (105)
- # onyx (56)
- # parinfer (29)
- # perun (12)
- # proton (1)
- # re-frame (14)
- # reagent (5)
- # sydney (1)
- # yada (15)
@malcolmsparks: maybe this would be an interesting example case to illustrate how to build more complex routing mechanisms. I'll try to write up my approach and then we could compare notes, come up with "the idiomatic" way if you like
let's say you have a number of requests to make (in this case each is a blocking call) and I'd like to do that with 5 requests at a time and get a stream of the results
in core.async you'd use a pipeline to do this, but i'm not really sure how to approach this with manifold
even not taking into account the controlled number of processes executing the requests, how do you convert a sequence of deferred's to a stream?
@stijn if you don't care about the order, then you could chain a callback to each deferred to stuff the value onto a stream
otherwise there is zip
to combine a bunch of deferreds and if that doesn't work for you then i guess you could try putting the deferred objects themselves onto a stream... i have no idea if that will cause explosions
@mccraigmccraig thanks! I found zip in the meantime. That works, an indeed keeps the order.
Putting the deferreds onto a stream works, but would you then (s/map deref) to get the values? That seems a bit unintuitive looking at how chain works for deferreds
also, i'm not sure what (s/map deref)
would do when one of the values in the stream hasn't been resolved
do you def need to preserve order ?
@malcolmsparks: Ta for the merge
@malcolmsparks: It looks like :body is a valid parameter for the :parameters option when configuring a resource (for a post) but it seems not to work… What might i be doing wrong?