Skip to content

Instantly share code, notes, and snippets.

@hlship
Created May 6, 2016 18:58
Show Gist options
  • Save hlship/a50657e63dbe507af72f0ab3599539c6 to your computer and use it in GitHub Desktop.
Save hlship/a50657e63dbe507af72f0ab3599539c6 to your computer and use it in GitHub Desktop.
consumer oriented loop
(defn customers [db ch]
(let [db-ch (exec-customer-query db :all)]
(go-loop []
(when-let [customer (<! db-ch)]
(>! ch customer)
(recur)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment