You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/15 11:40:41 UTC

[jira] [Commented] (TINKERPOP-1599) implement real gremlin-python driver

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

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

Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/554
  
    @davebshow now that code freeze is lifted i think you should probably rebase this PR. Also, two documentation related items:
    
    1. This works needs a changelog entry - it was probably better you didn't add that yet since you would have had to move it anyway to 3.2.5.
    2. This change seems sufficiently large and important that it should have some documentation on usage in the reference docs and should likely have an entry in the upgrade docs as well so that users know that there as an actual driver that can be used for python now.


> implement real gremlin-python driver
> ------------------------------------
>
>                 Key: TINKERPOP-1599
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1599
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: driver, language-variant
>    Affects Versions: 3.2.3
>            Reporter: David M. Brown
>            Assignee: David M. Brown
>             Fix For: 3.3.0
>
>
> It is high time that gremlin-python comes packaged with a real driver. After watching the community discussion, it seems that the way to go will be to use the {{concurrent.futures}} module with multithreading to provide asynchronous I/O. While the default underlying websocket client library will remain Tornado due to Python 2/3 compatibility issues, this should be decoupled from the rest of the client and easy to replace.
> With this is mind, I created a baseline client implementation with [this commit|https://github.com/apache/tinkerpop/commit/fb7e7f255585956abbb854fcc5dd3138113cf454] in a topic branch {{python_driver}}. Some things to note:
> - All I/O is performed using the {{concurrent.futures}} module, which provides a standard 2/3 compatible future interface.
> - The implementation currently does not include the concept of a cluster, instead it assumes a single host.
> - The {{transport}} interface makes it easy to plug in client libraries by defining a simple wrapper.
> - Because this is an example, I didn't fix all the tests to work with the new client implementation. Instead I just added a few demo tests. If we decide to move forward with this I will update the original tests.
> The resulting API looks like this for a simple client:
> {code}
> client = Client('ws://localhost:8182/gremlin', 'g')
> g = Graph().traversal()
> t = g.V()
> future_result_set = client.submitAsync(t.bytecode)
> result_set = future_result_set.result()
> results = result_set.all().result()
> client.close()
> {code}
> Using the {{DriverRemoteConnection}}:
> {code}
> conn = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
> g = Graph().traversal().withRemote(conn)
> t = g.V()
> results = t.toList()
> conn.close()
> {code}
> If you have a minute to check out the new driver code that would be great, I welcome feedback and suggestions. If we decide to move forward like this, I will proceed to finish the driver implementation.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)