Hey Chris,

I'm happy to inform you that this is already the case :)

If you loop through the entire result, it automatically gets closed.

/jake

On Wed, Nov 23, 2011 at 8:42 PM, Chris Diehl <cpdi...@gmail.com> wrote:

> Hi Jake,
>
> As you know, with the current Neo4j Python bindings, one needs to close
> the index results after doing a lookup and iterating through the results.
>
> hits = idx['akey']['avalue']
>  for item in hits:
>      pass
>
> # Always close index results when you are
>  # done, to free up resources.
>  hits.close()
>
>  Would it be possible to return an object that automatically closes hits
> after iteration is complete? I'd love to encapsulate the index in a class
> that takes care of the close for me so I don't have to worry about
> inserting that somewhere later in my code. Not exactly sure how to pull
> that off...
>
>  Chris
>



-- 
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to