Re: freeing resources while generating lazy sequences

2012-11-18 Thread Alex Pooley
Thanks for your feedback Stuart. The with-open route sounds like the way to go. Alex. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated -

Re: freeing resources while generating lazy sequences

2012-11-16 Thread Stuart Sierra
Lazy sequences do not interact well with resources that need to be closed. This is a long-standing issue, and no universal solution has been found. The usual recommendation is to manage the resource in a higher scope than the process that uses it. In your case, rather than creating the iterator

freeing resources while generating lazy sequences

2012-11-15 Thread Alex Pooley
Hey Folks, I am writing a thin Clojure wrapper around leveldbjni https://github.com/fusesource/leveldbjni Leveldbjni provides an iterator to walk over all key, value pairs in the database. I am trying to translate this iterator functionality in to a Clojure lazy sequence. I've built my