You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by David Jeske <da...@gmail.com> on 2010/12/15 05:48:58 UTC

another question - async handlers

I have another Avro question that isn't obvious from the current docs..

Does the current Avro compiler (for Java or C# stubs) support fully async
handlers?

By this I don't mean just non-blocking I/O for the I/O loop, but handlers
which can return their results via callback. I want a server-handler sub
that provides callbacks that can be used later (after the handler function
thread has returned), to return results -- so my handler doesn't need to sit
on the rpc calling thread until results are available.

It seems someone made some experimental Thrift patches to do this for C++,
but they were not accepted. It's possible the Thrift python twisted
interface does this (I don't know). However, I can't seem to find any
reference to this being available in Thrift for Java or C#. They only have
non-blocking I/O support, but the handler thread has to directly return the
result, which means it has to consume the thread until the result is
available.

http://markmail.org/thread/7xl2fpwn3hvao2jh#query:+page:1+mid:7xl2fpwn3hvao2jh+state:results

Make sense? Is this something that Avro has now? or not yet?

Re: another question - async handlers

Posted by Esteve Fernandez <es...@apache.org>.
Hi

On Wed, Dec 15, 2010 at 5:48 AM, David Jeske <da...@gmail.com> wrote:
> It seems someone made some experimental Thrift patches to do this for C++,
> but they were not accepted. It's possible the Thrift python twisted
> interface does this (I don't know).

Yes, the Twisted port of Thrift supports asynchronous handlers. Any
handler method may return a Deferred (a Future-like structure) whose
results may fire at a future point.

> However, I can't seem to find any
> reference to this being available in Thrift for Java or C#. They only have
> non-blocking I/O support, but the handler thread has to directly return the
> result, which means it has to consume the thread until the result is
> available.
> http://markmail.org/thread/7xl2fpwn3hvao2jh#query:+page:1+mid:7xl2fpwn3hvao2jh+state:results
> Make sense? Is this something that Avro has now? or not yet?

The Twisted port of Avro supports handler methods that return
Deferreds too. Also, I think the Netty port of Avro supports them too
(it's got a CallFuture class) [1], but I can't say for sure, Todd or
Harry can answer that question better than I :-)

Cheers.

1 - https://issues.apache.org/jira/browse/AVRO-405