-
-
Save l1x/836b23fe864dd0db1259 to your computer and use it in GitHub Desktop.
This file contains 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
;works but only if (count streams) => 1 | |
(defn messages | |
"" | |
[^ArrayList streams] | |
(log/info "#streams" (count streams)) | |
(let [ [^KafkaStream stream & _] streams ] | |
(map message-to-vec (lazy-messages (.iterator stream))))) | |
;does not work because it tries to get | |
;all of the messages from the first stream before moving on to the next | |
(defn messages-let | |
"" | |
[^ArrayList streams] | |
(log/info "#streams" (count streams)) | |
(for [ ^KafkaStream stream streams ] | |
(map message-to-vec (lazy-messages (.iterator stream))))) | |
;how can i do | |
;[stream stream stream ..... stream] | |
; => | |
;(message-first-stream message-second-stream message-third-stream ..... message-nth-stream | |
; message-first-stream......message-nth-stream) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment