[ 
https://issues.apache.org/jira/browse/THRIFT-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634516#action_12634516
 ] 

Ben Taitelbaum commented on THRIFT-148:
---------------------------------------

So from looking at your patch, it looks like to avoid having blocking reads 
when data isn't available, you read it all into a memory buffer, and then 
perform normal processing on that buffer, relying on an EOF exception if there 
isn't enough data available.

I think this solution will work in EventMachine as well, although I was hoping 
to do something more efficient, like be able to tell if there was enough data 
for a particular message more quickly (like reading bytes out of a buffer, and 
backing up as soon as you can tell that not enough bytes are available), but 
even with binaryprotocol, this was not easy, and with other protocols, it would 
be even harder.

Have you though about optimizations to the way you're doing network handling, 
or in practice is the overhead of creating a TMemoryBuffer and going until an 
EOF not really a bottleneck?

> Add support for Twisted
> -----------------------
>
>                 Key: THRIFT-148
>                 URL: https://issues.apache.org/jira/browse/THRIFT-148
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Python), Library (Python)
>            Reporter: Esteve Fernandez
>         Attachments: client.py, server.py, txthrift.patch
>
>
> This patch adds support for Twisted in both the compiler and the Python 
> library. Also attached are a client and a server based on the calculator 
> example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to