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

stephen mallette commented on TINKERPOP3-734:
---------------------------------------------

Te-worked {{ResultSet}} and some internal classes.  That {{poll}} method is 
basically gone.  Introduced this:

{code}
CompletableFuture<List<Result>> some(int items)
{code}

which grabs to "items" number of results and completes when that number arrives 
(or the streaming as a whole completes).  {{one}} uses that method but blocks 
until {{1}} is returned.  Also, wrote a bunch more tests.  

I don't intend to merge this to master until I run more tests, but I like how 
it looks a lot more now.  I could probably untangle the code some more in there 
too at some point.  I think i could combine/drop a class or two somewhere.

> Driver uses polling tying up threads
> ------------------------------------
>
>                 Key: TINKERPOP3-734
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-734
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: driver
>            Reporter: Adrian Gonzalez
>            Assignee: stephen mallette
>
> The driver uses polling to return ResultSet.one() and for the 
> CompletableFuture in ResultSet.all().
> Ideally polling should not be necessary when using Netty and 
> CompletableFutures.  This causes problems when trying to use it with a 
> framework like [vert.x|http://vertx.io/].
> Could you consider an approach more similar to the Cassandra driver from 
> datastax?
> https://github.com/datastax/java-driver
> See 
> [Session.executeAsync()|https://github.com/datastax/java-driver/blob/2.1/driver-core/src/main/java/com/datastax/driver/core/Session.java#L166]
>  which is equivalent to gremlin-driver Client.submitAsync().



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

Reply via email to