Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C252C116FA for ; Mon, 22 Sep 2014 17:51:30 +0000 (UTC) Received: (qmail 56620 invoked by uid 500); 22 Sep 2014 17:51:30 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 56584 invoked by uid 500); 22 Sep 2014 17:51:30 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 56572 invoked by uid 99); 22 Sep 2014 17:51:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 17:51:29 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aconway@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 17:51:25 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8MHp2Ot015882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 22 Sep 2014 13:51:02 -0400 Received: from [10.3.113.135] (ovpn-113-135.phx2.redhat.com [10.3.113.135]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8MHp1t5001258 for ; Mon, 22 Sep 2014 13:51:01 -0400 Message-ID: <1411408261.3082.45.camel@localhost> Subject: Re: Proton tutorial: synchronous request-response From: Alan Conway To: users@qpid.apache.org Date: Mon, 22 Sep 2014 13:51:01 -0400 In-Reply-To: References: <1411061014.2381.10.camel@localhost> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, 2014-09-18 at 13:33 -0400, Justin Ross wrote: > http://svn.apache.org/viewvc/qpid/proton/branches/examples/tutorial/sync_client.py?view=markup&pathrev=1626029 > > I think "invoke" is an unintuitive name there. It's not "invoking the > request" or "invoking the client". Invoke usually implies a named piece of > application logic. I think in this case "send" or "send_request" would be > better, as in "send the request (and this is a request for which I expect a > synchronous response)". Yes I don't really like invoke either but I also don't like send. I want to say: "send a request *and* wait for a response". The word "send" is heavily used already in all the messaging APIs to mean "just send a message". I also considered "call". This really is the moral equivalent of an RPC (C for "call") The only difference between this and RPC is dressing it up as a method call on a proxy object instead of exposing the underlying message exchange. However given that we want to expose this as a message exchange, neither "invoke" nor "call" is very satisfying. I'd love a better alternative! > > On Thu, Sep 18, 2014 at 1:23 PM, Alan Conway wrote: > > > I checked this in on the examples branch. > > > > ------------------------------------------------------------------------ > > r1626029 | aconway | 2014-09-18 13:11:12 -0400 (Thu, 18 Sep 2014) | 7 > > lines > > > > NO-JIRA: Added tutorial/sync_client.py to demonstrate a synchronous > > request-response client. > > > > This client uses the familiar paradigm of making blocking calls that > > send a > > request and return the response. > > > > Made some improvements to BlockingThread error handling and timeouts. > > > > ------------------------------------------------------------------------ > > > > It needs a little work to be realistic (needs to check correlation ids > > at least) but it is quite neat. > > > > Most of the current tutorial examples are in an event driven style, > > which is great for servers and intermediaries but less familiar on the > > client side. This demo shows that you can also do traditional > > client-driven request response quite easily. The error handling is > > simple: invoke() throws if anything goes wrong. > > > > I did this the hard way first - by writing my own raw event handlers. It > > was instructive but, well, hard. Then I noticed Gordon's > > BlockingConnection class already did everything I had figured out the > > hard way (blocking and error handing) so I rewrote it using that and it > > was very easy. > > > > So far I think this is promising. > > > > Cheers, > > Alan. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > > For additional commands, e-mail: users-help@qpid.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org