java - doseq with KafkaStream evaluates previous item -


i want pop messages kafkastream , process them. kafkastream implements java.lang.iterable thought put stream doseq , consume messages come in. happens message passed body of doseq when message added kafkastream, 'pushing' out.

(doseq [msg (map unpack-message ^kafkastream stream)]     (handler msg)) 

what have implement done in https://github.com/pingles/clj-kafka/blob/master/src/clj_kafka/consumer/zk.clj lazy-iterate , build seq using iterator. works have no idea why, explain?

one other more weird thing if put log line in unpack-message function see evaluated when message comes in. message unpacked in lazy function map not taken doseq event though kind of sitting in there waiting. don't understand.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -