You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Willem Jiang <wi...@gmail.com> on 2009/05/09 05:29:22 UTC

Re: svn commit: r773035 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/util/ tests/camel-itest/src/test/java/org/apache/camel/itest/async/ tests/camel-itest/src/test/resources/

davsclaus@apache.org wrote:
> Author: davsclaus
> Date: Fri May  8 15:41:29 2009
> New Revision: 773035
> 
> URL: http://svn.apache.org/viewvc?rev=773035&view=rev
> Log:
> CAMEL-1572: Added async sample for show and tell of the new Async API.
> 

> +
> +        // so we use the async extract body to return a string body response
> +        // this allows us to do this in a single code line instead of using the
> +        // JDK Future API to get hold of it, but you can also use that if you want
> +        String response = template.asyncExtractBody(future, String.class);
> +        assertEquals("Bye World", response);
> +
How about name the method with extractFutureBody?
asyncExtractBody makes me think it's async method call, but in fact it
will block the calling thread if the feature is not done yet.

Willem

Re: svn commit: r773035 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/util/ tests/camel-itest/src/test/java/org/apache/camel/itest/async/ tests/camel-itest/src/test/resources/

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, May 9, 2009 at 5:29 AM, Willem Jiang <wi...@gmail.com> wrote:
> davsclaus@apache.org wrote:
>> Author: davsclaus
>> Date: Fri May  8 15:41:29 2009
>> New Revision: 773035
>>
>> URL: http://svn.apache.org/viewvc?rev=773035&view=rev
>> Log:
>> CAMEL-1572: Added async sample for show and tell of the new Async API.
>>
>
>> +
>> +        // so we use the async extract body to return a string body response
>> +        // this allows us to do this in a single code line instead of using the
>> +        // JDK Future API to get hold of it, but you can also use that if you want
>> +        String response = template.asyncExtractBody(future, String.class);
>> +        assertEquals("Bye World", response);
>> +
> How about name the method with extractFutureBody?
> asyncExtractBody makes me think it's async method call, but in fact it
> will block the calling thread if the feature is not done yet.
Good idea willem, I was in doubt with a good name so I took the
internal extractBody name at first.
Your idea is much better, so lets use it.

>
> Willem
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration
Interview with me:
http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress