Iv been giving core.async a spin in clojurescript/nodejs settings and 
stumbled upon a simple use case:


   - You have two channels c1 and c2 both produced from http calls
   - c2 is produced from a call the consumes c1 result as an input


(let [id (<! (POST "/foo"))]
    (<! (GET (str "/foo/" id)))

The issue is that since there are two channels here the GET will be issued 
with nil (there is not synchronization between the two), 

One options that comes to mind is using alts! with :priority but from I can 
tell I cant pass the result of the first channel to the second.

My solution was to use take!:

(take! (POST "/foo")
  (fn [id] (GET (str "/foo/" id)))

But this is a bit backwards and gets me back to callback land, 

Any suggestion will be appreciated

Thanks

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to