Created
May 6, 2016 18:58
-
-
Save hlship/a50657e63dbe507af72f0ab3599539c6 to your computer and use it in GitHub Desktop.
consumer oriented loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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