You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "zhang heng (JIRA)" <ji...@apache.org> on 2016/10/22 08:08:00 UTC

[jira] [Commented] (THRIFT-1972) Add support for async processors

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

zhang heng commented on THRIFT-1972:
------------------------------------

Hey guys, I wrote a  simple proxy server based on this feature,  and comparing it with the original TThreadedSelectorServer. But the results confuse me very much, which is the QPS of the server using async processor  is only half of the original, and the average response time is almost twice the original. Then I read most of the thrift java lib source code, and still have no clue.  Can you help me to find a explanation? Here is the repo of my test code: https://github.com/kapsterio/thriftAsyncServer

> Add support for async processors
> --------------------------------
>
>                 Key: THRIFT-1972
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1972
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler, Java - Library
>            Reporter: T Jake Luciani
>            Assignee: T Jake Luciani
>             Fix For: 0.9.1
>
>         Attachments: 1972.txt
>
>
> This patch adds async processors that work with the existing Nonblocking server implementations, by using the existing AsyncIface service implementation.
> It uses the callback handler for each method to allow the implementation to respond in a asynchronous fashion. 
> {code}
>     public void testStruct(Xtruct thing, AsyncMethodCallback resultHandler);
> {code}
> When the implementation is ready to respond to a client it passes the result or exception to the onSuccess/onError call of the result handler, which will in turn send the response to the client.
> We plan to use this to allow clients to send requests and wait for a event to occur on the server without using one thread per blocking call.



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