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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -