Fork me on GitHub
#yada
<
2016-02-23
>
martinklepsch11:02:54

@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

stijn13:02:38

I have a question on manifold.

stijn14:02:49

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

stijn14:02:13

in core.async you'd use a pipeline to do this, but i'm not really sure how to approach this with manifold

stijn14:02:21

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?

stijn14:02:36

anyone any examples/suggestions?

mccraigmccraig17:02:43

@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

mccraigmccraig17:02:55

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

stijn19:02:47

@mccraigmccraig thanks! I found zip in the meantime. That works, an indeed keeps the order.

stijn19:02:05

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

mccraigmccraig19:02:05

also, i'm not sure what (s/map deref) would do when one of the values in the stream hasn't been resolved

mccraigmccraig19:02:15

do you def need to preserve order ?

dominicm19:02:01

I wonder if it fns values as they arrive

jannis22:02:56

@malcolmsparks: Ta for the merge simple_smile

ericfode22:02:55

@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?