[ 
https://issues.apache.org/jira/browse/TINKERPOP3-790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14711124#comment-14711124
 ] 

stephen mallette commented on TINKERPOP3-790:
---------------------------------------------

I had expected that some {{TraversalStrategy}} would implement 
{{AutoCloseable}} as needed and those that did would have {{close()}} called - 
basically a lightweight version of the full hierarchy concept {[~mhfrantz] 
mentioned.  I hadn't come across a spot yet where a {{GraphTraversal}} needs to 
"close".  Seems like it wouldn't be bad for the {{GraphTraversalSource}} to 
just spawn independent {{Traversal}} objects. That doesn't seem too confusing 
to me, but now that it's been mentioned, it might not be a bad idea to consider 
if we can think of a use case where it would matter.

> Implement AutoCloseable on TraversalSource
> ------------------------------------------
>
>                 Key: TINKERPOP3-790
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-790
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: stephen mallette
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.1.0-incubating
>
>
> A {{TraversalSource}} may have resources to release so having a {{close}} 
> method would allows that release to occur.  The specific case has to do with 
> {{EventStrategy}} which registers a listener on {{Transaction}}.  That 
> listener should be removed when the user is done with the 
> {{TraversalSource}}, but there is currently no way to clean that up.  The 
> calling of {{close}} should prevent future traversals from that 
> {{TraversalSource}}. 
> I suppose this also means that a {{TraversalStrategy}} will need to 
> optionally implement {{AutoCloseable}} or some other marker interface to 
> designate it as a strategy that needs to release resources.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to