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

ASF GitHub Bot commented on THRIFT-3112:
----------------------------------------

Github user jsirois commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/840#discussion_r53405396
  
    --- Diff: lib/java/src/org/apache/thrift/async/TAsyncMethodCall.java ---
    @@ -225,8 +231,13 @@ private void cleanUpAndFireCallback(SelectionKey key) {
         key.interestOps(0);
         // this ensures that the TAsyncMethod instance doesn't hang around
         key.attach(null);
    --- End diff --
    
    Adding cancel won't (doesn't) work.  The key is associated with the single 
underlying channel (wrapped in a `TNonblockingTransport`) from the 
`TAsyncClient` which is intended for use with multiple concurrent calls afaict. 
 The `org.apache.thrift.async.TestTAsyncClientManager#testParallelCalls` test 
uses the client in this way - 1 client, multiple concurrent calls - and 
demonstrates that cancelling the key cancels the underlying channel and, for 
example, you get 1 successful call and 4999 failed calls in the 5000 call test 
case as a result.


> [Java] AsyncMethodCallback should be typed in generated AsyncIface
> ------------------------------------------------------------------
>
>                 Key: THRIFT-3112
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3112
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler, Java - Library
>    Affects Versions: 0.9.2
>            Reporter: Sergei Egorov
>            Assignee: John Sirois
>
> AsyncMethodCallback is generic, but current Java code generator is not adding 
> type info to it, and instead of:
> {code:java}
> public interface AsyncIface {
>     public void ping(org.apache.thrift.async.AsyncMethodCallback<String> 
> resultHandler) throws org.apache.thrift.TException;
>  }
> {code}
> we have:
> {code:java}
> public interface AsyncIface {
>     public void ping(org.apache.thrift.async.AsyncMethodCallback 
> resultHandler) throws org.apache.thrift.TException;
>  }
> {code}



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

Reply via email to