[
https://issues.apache.org/jira/browse/THRIFT-3770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15221342#comment-15221342
]
ASF GitHub Bot commented on THRIFT-3770:
----------------------------------------
GitHub user vmarkovtsev opened a pull request:
https://github.com/apache/thrift/pull/972
THRIFT-3770 Implement Python 3.4+ asyncio support
I decided to take an approach which is different from Tornado
implementation and do not nail supported protocols to the Framed one. My effort
enables BinaryProtocol.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vmarkovtsev/thrift THRIFT-3770
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/972.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #972
----
commit 16f108442feafe1933d07ac047da69a092f13114
Author: Markovtsev Vadim <[email protected]>
Date: 2016-03-31T14:22:55Z
Add binary protocol support for asyncio
Example:
import asyncio
from hbase.Hbase import Client
from thrift.TAsyncio import TAsyncioTransport, TAsyncioBinaryProtocol
def work(loop):
transport = yield from TAsyncioTransport.connect(
'hbase', 9090, loop)
client = Client(TAsyncioBinaryProtocol(transport))
tables = yield from client.getTableNames()
print(tables)
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(work(loop))
finally:
loop.close()
----
> Support Python 3.4+ asyncio support
> -----------------------------------
>
> Key: THRIFT-3770
> URL: https://issues.apache.org/jira/browse/THRIFT-3770
> Project: Thrift
> Issue Type: Bug
> Components: Python - Compiler, Python - Library
> Affects Versions: 1.0
> Reporter: Vadim Markovtsev
> Priority: Minor
> Labels: features
>
> Currently, Tornado and Twisted async engines are supported in client lib and
> the compiler. asyncio is a relatively new engine which is included into
> Python 3.4+ standard library. It is gaining popularity fast.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)