Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Thrift have async server side method definitions for Java?

I can wire up an HsHaServer and Async client in Java and get it all running swimmingly. The problem is that there doesn't seem to be an async interface for truly async services. The service interface is something like

public TSomeReposonse doStuff( TSomeParams params );

which requires me to block inside of doStuff until am ready to return TSomeResponse

There is an Async.Iface

public void doStuff( TSomeParams params, AsyncMethodCallback[AsyncClient.doStuff_call] );

but it looks like that is only for the client side. There doesn't seem to be a way to pass a value into the callback. Am I right in this? If I want true server-side asynchrony do I need to implement my own client/server with something like netty?

Thanks, Andrew

like image 292
Andrew Avatar asked Nov 06 '12 18:11

Andrew


1 Answers

This question is pretty old (there's probably a badge for this), but just in case this is relevant to someone, the answer is yes. It is called Asynchronous Processing - see here: https://issues.apache.org/jira/browse/THRIFT-1972

It uses the same interface an async client would use.

There is an almost ridiculous lack of documentation about this though.

like image 94
Barak Avatar answered Oct 19 '22 19:10

Barak