thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From melchizedec Sundararaj <mel...@cloudinfra.in>
Subject waiting for async calls to complete
Date Mon, 21 Jan 2013 10:39:14 GMT
Hi Thrift users,

I am invoking multiple async calls of thrift from my code. I would like to
wait for all of them to complete before going on with my next stage.

for (...) {
  TNonblockingTransport transport = new TNonblockingSocket(host, port);
  TAsyncClientManager clientManager = new TAsyncClientManager();
  TProtocolFactory protocolFactory = new TBinaryProtocol.Factory();
  AsyncClient c = new AsyncClient(protocolFactory, clientManager, transport);
  c.function(params, callback);

}

// I would like to wait for all the calls to be complete here.


One way is to have the callbacks keep decrementing an outstanding call
counter and signal.  Is there a better way to do this ?  I expected the
clientManager or the AsyncClient to have some way for me to wait till the
call completes.  but couldnt find one.

Any thoughts on how to do that would be really helpful.

Regards
Melchi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message