Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 26668 invoked from network); 6 Dec 2007 23:07:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2007 23:07:10 -0000 Received: (qmail 79125 invoked by uid 500); 6 Dec 2007 23:06:57 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 79083 invoked by uid 500); 6 Dec 2007 23:06:57 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 79072 invoked by uid 99); 6 Dec 2007 23:06:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 15:06:57 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 23:06:45 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7767571425D for ; Thu, 6 Dec 2007 15:06:48 -0800 (PST) Message-ID: <25737067.1196982408486.JavaMail.jira@brutus> Date: Thu, 6 Dec 2007 15:06:48 -0800 (PST) From: "Sangjin Lee (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Commented: (GERONIMO-3615) AsyncHttpClient.sendRequest() should return a future In-Reply-To: <4094332.1195605403218.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-3615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549227 ] Sangjin Lee commented on GERONIMO-3615: --------------------------------------- Thanks. I'll do that from now on... > AsyncHttpClient.sendRequest() should return a future > ---------------------------------------------------- > > Key: GERONIMO-3615 > URL: https://issues.apache.org/jira/browse/GERONIMO-3615 > Project: Geronimo > Issue Type: New Feature > Security Level: public(Regular issues) > Components: AsyncHttpClient > Affects Versions: 1.x > Reporter: Sangjin Lee > Attachments: patch.zip > > > Currently the caller gets notified when the I/O is completed via AsyncHttpClientCallback. While this works for many use cases, there may be situations where sendRequest() returning a future would lead to a much more straightforward programming model. This will become much more powerful especially if one initiates requests to multiple URLs at once. > I would request that sendRequest() return a future object on which one can query the status of the operation, and also obtain the result or an error case (exception or timeout) by calling methods on the future. It is desirable to have the return type implement java.util.concurrent.Future. > Furthermore, the implementation class of the Future could retain the reference to the callback. Then one can have a consolidated and coherent mechanism of completion (callbacks firing as a result of future completion). > In other words, the suggestion is to change the return type of sendRequest() from void to java.util.concurrent.Future. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.