[
https://issues.apache.org/jira/browse/AVRO-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044680#comment-13044680
]
James Baldassari commented on AVRO-539:
---------------------------------------
I just finished a new version of the patch that I think addresses all the
issues we've been discussing here so far. Here is a summary of the changes
since the first patch:
* Removed "Asynchronous" from all method names. The new methods are just
overloaded with an additional Callback parameter now.
* Removed the CallFuture from the new generated client interfaces. These
methods simply take an additional Callback<T> parameter and return void. For
example:
** void add(int arg1, int arg2, Callback<Integer>) throws IOException;
* Modified CallFuture
** Replaced the Semaphore with a CountDownLatch
** Made CallFuture implement Callback, and replaced the set(Result|Error)
methods with handle(Result|Error)
* If clients want to use a Future-based API, just create a new CallFuture<T>
and pass it in as the Callback<T> parameter, then wait on the CallFuture.
* The SpecificCompiler takes a new boolean argument, called
generateClientInterface, that controls whether the client-specific interfaces
with the Callback methods will be generated. The Maven and Ant plugins also
accept this parameter. The default value is currently set to true, but it's
easy enough to default it to false if that is preferred.
* The default implementation of Transceiver.transceive(List<ByteBuffer>,
TransceiverCallback) now works synchronously rather than throwing
UnsupportedOperationException. This allows the Callback-enabled interfaces to
be used with non-Netty Transceivers.
* Requestor.request(String, Object) is now implemented using the Callback API.
This eliminates duplication of code and functionality between the synchronous
and callback APIs.
* New unit test, TestProtocolNetty, which runs all TestProtocolSpecific tests
using NettyServer and NettyTransceiver. In particular, this verifies that the
two-step protocol handshake works when using the Callback API (since the
synchronous API is implemented using the Callback API)
* Merged in changes from AVRO-832
I think that's about it. Please take a look when you get a chance, and let me
know what you think.
> Allow asynchronous clients to specify a callback to be run when server
> processing completes
> -------------------------------------------------------------------------------------------
>
> Key: AVRO-539
> URL: https://issues.apache.org/jira/browse/AVRO-539
> Project: Avro
> Issue Type: New Feature
> Reporter: Jeff Hammerbacher
> Attachments: AVRO-539.patch
>
>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira