Skip to content

Instantly share code, notes, and snippets.

@briansunter
Created September 8, 2016 06:02
Show Gist options
  • Save briansunter/bbca06257b2398073192156c8a00850f to your computer and use it in GitHub Desktop.
Save briansunter/bbca06257b2398073192156c8a00850f to your computer and use it in GitHub Desktop.
Infinite reddit post channel
(defn get-posts
[ch]
(go-loop [a nil]
(let [res (get-posts-page a)
posts (res :children)
after (res :after)]
(do
(doseq [p posts]
(>! ch p))
(recur after)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment