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

ASF GitHub Bot commented on TINKERPOP-1490:
-------------------------------------------

Github user davebshow commented on the issue:

    https://github.com/apache/tinkerpop/pull/478
  
    @aholmberg I'm not sure if I follow...it seems to me that if a 
`RemoteConnection` implementation returns a list (or future list ) of 
`FutureTraversers`, the traversal API can still remain independent from the 
transport. Even if the GLV needs to operate on the Traversers, 
`asyncio.Future`, `concurrent.Future`, and `tornado.concurrent.Future` have 
compatible APIs (`done`, `cancel`, `add_done_callback`, `result`, `set_result`, 
`etc.`). The "specialized" handling of the future, whether it be a coroutine 
that requires a `yield`, `yield from`, or `await` expression, or a 
`concurrent.Future`, will in the end be handled by application code written by 
the end user.


> Provider a Future based Traversal.async(Function<Traversal,V>) terminal step
> ----------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1490
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1490
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: language-variant, process
>    Affects Versions: 3.2.2
>            Reporter: Marko A. Rodriguez
>
> [~mbroecheler] had the idea of adding a {{Traversal.async()}} method. This is 
> important for not only avoiding thread locking on a query in Gremlin, but 
> also, it will allow single threaded language variants like Gremlin-JavaScript 
> to use callbacks for processing query results.
> {code}
> Future<List<String>> result = 
> g.V().out().values("name").async(Traversal::toList)
> {code}
> {code}
> Future<List<String>> result = g.V().out().name.async{it.toList()}
> {code}
> {code}
> g.V().out().values('name').async((err,names) => {
>   // I don't know JavaScript, but ...
>   return list(names);
> }) 
> {code}
> ...



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

Reply via email to