Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yayitswei
Created August 28, 2013 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yayitswei/6362139 to your computer and use it in GitHub Desktop.
Save yayitswei/6362139 to your computer and use it in GitHub Desktop.
core.async trouble
(defn fetch-user [username]
(go
(let [ch (chan)]
(letrpc [user (get-user-info username)] ;; shoreleave remote's letrpc macro
(>! ch user)
(close! ch))
ch)))
(defn display-user-info [username]
(go (let [u (<! (fetch-user username))]
(log u) ;; prints out a channel instead of a user map
)))
(display-user-info "wei")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment