Created
February 11, 2019 23:07
-
-
Save teaforthecat/d250d355225133c57f1da2c3eb191616 to your computer and use it in GitHub Desktop.
lazy stream of kafka messages in clojure
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 message-stream | |
([c] | |
(message-stream c ())) | |
([c a] | |
(lazy-seq | |
(cons a | |
(message-stream c (seq (poll! c))))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment