You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Craig Landry <cr...@gmail.com> on 2011/12/10 18:08:15 UTC

Asynchronous Clients With HttpTransceiver

I'm trying to make use of the async client functionality that was
added for AVRO-539 but from what I can tell it will only work
asynchronously with the NettyTransceiver.  Are there any plans to add
this functionality to the HttpTransceiver?

Re: Asynchronous Clients With HttpTransceiver

Posted by Doug Cutting <cu...@apache.org>.
On 12/10/2011 11:56 AM, James Baldassari wrote:
> It should be possible to add async support to HttpTransceiver as well. 
> I think the only issue preventing HttpTransceiver from working
> asynchronously is the lack of support for out-of-order responses:

The HTTP protocol doesn't naturally support out-of-order responses.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.2.2

A way to do this over HTTP might be to use a Comet-like approach:

http://en.wikipedia.org/wiki/Comet_(programming)

but I really think that async is better added to the non-HTTP
implementations.  In particular, I'd like to see it added to the SASL
implementation, SaslTransceiver.  I think the approach I outlined in
AVRO-625 still makes sense there, I just haven't had a chance to
implement it yet.  Alternately, NettyTransceiver could be made to
implement Avro's SASL profile and make it's async support
back-compatible through the approach outlined in AVRO-625.

Doug

Re: Asynchronous Clients With HttpTransceiver

Posted by Craig Landry <cr...@gmail.com>.
Thanks James, good to know.  I'll keep an eye on AVRO-625.

On Sat, Dec 10, 2011 at 1:56 PM, James Baldassari <jb...@gmail.com> wrote:
> Hi Craig,
>
> You're correct.  While the async interfaces are compatible with all
> transceiver implementations, only NettyTransceiver is truly asynchronous.
> When using the async interface with any other transceiver it will simply
> behave in a synchronous way by blocking until the response is returned.
>
> It should be possible to add async support to HttpTransceiver as well.  I
> think the only issue preventing HttpTransceiver from working asynchronously
> is the lack of support for out-of-order responses:
>
> https://issues.apache.org/jira/browse/AVRO-625
>
> Once that issue has been resolved I think it should be easy to make
> HttpTransceiver asynchronous.  Looking at AVRO-625 it seems like there is
> some debate about what the best approach is for implementing this
> functionality.  For example, to prevent breaking existing code that uses
> HttpTransceiver, users of the synchronous interface should be able to
> specify whether they want to allow out-of-order responses.  I can imagine
> that some uses of this transceiver may depend on the current in-order
> behavior, so that should probably be the default.
>
> -James
>
>
>
> On Sat, Dec 10, 2011 at 12:08 PM, Craig Landry <cr...@gmail.com>
> wrote:
>>
>> I'm trying to make use of the async client functionality that was
>> added for AVRO-539 but from what I can tell it will only work
>> asynchronously with the NettyTransceiver.  Are there any plans to add
>> this functionality to the HttpTransceiver?
>
>

Re: Asynchronous Clients With HttpTransceiver

Posted by James Baldassari <jb...@gmail.com>.
Hi Craig,

You're correct.  While the async interfaces are compatible with all
transceiver implementations, only NettyTransceiver is truly asynchronous.
When using the async interface with any other transceiver it will simply
behave in a synchronous way by blocking until the response is returned.

It should be possible to add async support to HttpTransceiver as well.  I
think the only issue preventing HttpTransceiver from working asynchronously
is the lack of support for out-of-order responses:

https://issues.apache.org/jira/browse/AVRO-625

Once that issue has been resolved I think it should be easy to make
HttpTransceiver asynchronous.  Looking at AVRO-625 it seems like there is
some debate about what the best approach is for implementing this
functionality.  For example, to prevent breaking existing code that uses
HttpTransceiver, users of the synchronous interface should be able to
specify whether they want to allow out-of-order responses.  I can imagine
that some uses of this transceiver may depend on the current in-order
behavior, so that should probably be the default.

-James


On Sat, Dec 10, 2011 at 12:08 PM, Craig Landry <cr...@gmail.com>wrote:

> I'm trying to make use of the async client functionality that was
> added for AVRO-539 but from what I can tell it will only work
> asynchronously with the NettyTransceiver.  Are there any plans to add
> this functionality to the HttpTransceiver?
>