Hi guys...I've a code similar to this:

(defn user-data []
  (!/go
    (let [a             (!/<! (<fun-async 2))
          b              (!/<! (<fun-async a))]
      {:response b})))

(defn handler-something []
  (let [data (!/<!! (user-data))] ;;block here
    (print data)
    (response  data......)))

user-data do a sucession of async calls and return a channel (because it's 
inside a go block no?) 
my handler-something need extract this data and return it in a ring 
response...I can wrap my response function inside a go block, if I do this 
I get

java.lang.IllegalArgumentException: No implementation of method: :render of 
protocol: #'compojure.response/Renderable found for class: 
clojure.core.async.impl.channels.ManyToManyChannel

so basically I use a block get <!! and then return the data...I'm more 
familiar with FRP and in FRP I would use a "onComplete" method which 
basically do the same as <!!

this pattern is correct or I'll end blocking code?...which could be the 
best approach for this?..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/d/optout.

Reply via email to