I have released a library for fusing a stream, decoder, and resource management into a reducible object with the intent to automatically manage resources. You can then apply a transducer to this object. This means you can apply a transducer pipeline that only partially consumes the stream, yet will close the stream nonetheless.
You can also use this object as a sequence, though in that case it will load the entire decoded sequence into memory at the same time. There's a big difference between `(into [] (take 1) (decode-edn! stream))` and `(take 1 (decode-edn! stream))`.
The library is called pjstadig/reducible-stream, and is at
https://github.com/pjstadig/reducible-stream/There is also a blog post covering the concepts:
http://paul.stadig.name/2016/08/reducible-streams.htmlI hope others find this useful. It's somewhat experimental, so caveat emptor. I welcome feedback.
Cheers!
Paul