+1

The obvious/preferred route (for me), since the vertices() and edges() methods 
in org.apache.tinkerpop.gremlin.structure.Graph return Iterator, is to have 
them return an interface that extends Iterator and AutoCloseable. If you create 
a new interface in 3.x for this, it would probably be CloseableIterator rather 
than the CloseableIterable of 2.x.

Alternative (messy) could make Graph responsible for this. Have it register 
each iterator and close it after period of inactivity exceeds a timeout, or if 
the Graph itself is closed. That's all I got.

-Paul


On 2016-12-28 08:27 (-0500), Stephen Mallette <[email protected]> wrote: 
> In TinkerPop 2.x we had a CloseableIterable class which allowed graphs like
> Sparksee and OrientDB to release server resources. Luca recently brought up
> this topic on the gremlin-users mailing list:
> 
> https://groups.google.com/d/msg/gremlin-users/lHepXl_Nle4/n3QeYqmNCwAJ
> 
> Is there any way to implement this without having something like
> CloseableIterable? Traversal already implements AutoCloseable which could
> call close() to the underlying iterator. We use close() for remoting
> Traversals at this point. There is nothing analogous for a standard
> traversal instance.
> 
> Thoughts?
> 

Reply via email to