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 2F7AB19372 for ; Fri, 15 Apr 2016 17:29:40 +0000 (UTC) Received: (qmail 63987 invoked by uid 500); 15 Apr 2016 17:29:39 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 63954 invoked by uid 500); 15 Apr 2016 17:29:39 -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 63941 invoked by uid 99); 15 Apr 2016 17:29:39 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 17:29:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E1C811A015D for ; Fri, 15 Apr 2016 17:29:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pkzhIPwBLEQv for ; Fri, 15 Apr 2016 17:29:36 +0000 (UTC) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 69C265F39B for ; Fri, 15 Apr 2016 17:29:35 +0000 (UTC) Received: by mail-oi0-f68.google.com with SMTP id w18so14570321oie.2 for ; Fri, 15 Apr 2016 10:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=pqGgnS+Sfdb1k0GI23vGDTo27Dc0yyHHlKQTUQ1H2fw=; b=vOTAr/qBotT0JuA35ZYykOcxrflJblj+a0CLIUKAR7JzjjPYKJFzCzQvp1vM8N6a7X 0HxdURBF7tSJAerA5iZ+bxKPGjMIx9+u0Y9wyyTehHERX8YDoIhLJFlcXQm3UiNZ7VN1 Lu0MGVAouIUR6cfPwxfEGUVNDTH60Y9tz+qIbiLagzuirckKbJR2C6ZVvPhF/RjwJRHV cKf0bcqWPWpWfJaJLdB5u4WnJy1irIwu4CyBuuKRVGOmXePCH9ueq3pBgkHI5dOV3V9f l+n4ugKWaSdUR08rBhAvx/ZFbvA/dsp91ZzWz0HL/AqF9OMpNFGLkZjiPkM3X3ap4EwN NoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=pqGgnS+Sfdb1k0GI23vGDTo27Dc0yyHHlKQTUQ1H2fw=; b=fGj3QmpZCASdUNgbVP5bbd7ZYe0Kfv5Lv5Qoqo4Tt1qbkBe+U2Y/pdgk7I0SROeFO5 1I+z3PX8+uvEOFWxYuu5VL4kr11/9RPqy/cReQR67pJPOnvOAY0CwhAGVB1ms8fN1tnS p/Fb7zWwr/jatEvduRhwzBK8QnJsXKRK1+8HxbhuEcWCwJaU/mV18OeB2/cWYmQ8ZCAW Os2bpmdC/66F/RokRkk+ta93JZ9jW7A5iNQN091h/z5knG86P2YNbfO/wtU6kQYB6jg7 2cKu0kBw48zgU5+Emt/vktw3FUXGuF5jOphLhaDIbvuSqXqzgGI6xvEMuKJ0gGK3CuHX /GKg== X-Gm-Message-State: AOPr4FXGPHXu+154qjfBCU4RquuivNFxxV24T8KLvynsO78lHYPWpahdyDBtn1kZvqTmguvfq3U+7qC3RwLVUA== MIME-Version: 1.0 X-Received: by 10.202.168.215 with SMTP id r206mr6577701oie.40.1460741374286; Fri, 15 Apr 2016 10:29:34 -0700 (PDT) Received: by 10.182.103.134 with HTTP; Fri, 15 Apr 2016 10:29:34 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Apr 2016 19:29:34 +0200 Message-ID: Subject: Re: Proton C++ API update From: Alexandre Trufanow To: users@qpid.apache.org Content-Type: multipart/alternative; boundary=001a113cd9a6b924f70530895aba --001a113cd9a6b924f70530895aba Content-Type: text/plain; charset=UTF-8 The changes look good overall, removing the event class makes the handler's API much cleaner IMO. I found the on_unhandled callback very useful for testing/debugging, when I didn't know what event to expect for my unit tests. Do you think there could be another way of setting a catchall for events? The obvious workaround would be to implement all callbacks but this is much more clunky. Thanks Alexandre On Thu, Apr 14, 2016 at 8:06 PM, Justin Ross wrote: > Hi, everyone. Our work on the Proton C++ API has progressed quite a bit, > and it's time to talk about the changes. > > First, a confession. I described the API we delivered in 0.12.0 as > "substantially settled", excepting some of the extension APIs and those API > elements that were hidden in the API docs. > > Our work since then has now exceeded what one can reasonably allow inside > the confines of "substantially settled". I'll try to detail the changes > and their rationales. After that I'll talk about our plan moving forward. > > There have also been many additions that do not affect API compatibility. > I won't list all of those here, but you can explore them on the API spec. > > http://home.apache.org/~jross/pumpjack/index.html > > Before I enumerate the changes, however, I'd like to say that we really > very much appreciate the use and feedback we've received on the API so > far. It is absolutely invaluable, we're grateful, and we want more. > > ## Event handling > > http://home.apache.org/~jross/pumpjack/core/handler/index.html > > - Handler callback signatures > - The handler callbacks now take relevant objects as inputs > - We removed event (the arg and the API type) > - In each callback, the first input argument is an entry-point into the > endpoint object tree and can be used for navigation to parent objects such > as container > - We renamed on-start and on-stop to on-container-start and > on-container-stop; these now take container > - We removed on-unhandled > - We renamed on-unhandled-error to simply on-error > > You can see the effect on the examples here: > > > https://github.com/apache/qpid-proton/blob/master/examples/cpp/helloworld.cpp > https://github.com/apache/qpid-proton/tree/master/examples/cpp > > ## Message > > http://home.apache.org/~jross/pumpjack/core/message/index.html > > - We renamed "address" to "to", retaining "address" as an alias; "to" > matches the AMQP spec and better illustrates the relation to "reply-to" > - We renamed application-properties to properties; "properties" is used in > the sense of application-supplied properties throughout the API > > ## Sender and receiver instead of link > > http://home.apache.org/~jross/pumpjack/core/sender/index.html > http://home.apache.org/~jross/pumpjack/core/receiver/index.html > > - We previously offered properties and methods on link that were useful > only if the link was a receiver or vice versa; instead we now provide only > the relevant members on sender and receiver respectively > - This is reflected in the event handlers as well: there are now dedicated > handler methods for senders versus receivers > - Sender and receiver options are split accordingly > > ## Source and target instead of terminus > > http://home.apache.org/~jross/pumpjack/core/source/index.html > http://home.apache.org/~jross/pumpjack/core/target/index.html > > - Same story as sender and receiver; source and target now contain no > context-dependent members > - Source and target options are split accordingly > > ## Tracker and delivery^r instead of delivery > > http://home.apache.org/~jross/pumpjack/core/tracker/index.html > http://home.apache.org/~jross/pumpjack/core/delivery/index.html > > - Delivery was previously used for both the sending and receiving sides of > a transfer; it is now separated for the same reasons as sender and > receiver, source and target > - A tracker is associated with sending: it tracks a message transfer from > the sender's perspective > - A delivery (in the revised sense) is a message transfer being received > > ## Flow control > > > http://home.apache.org/~jross/pumpjack/core/receiver/index.html#flow-control > > - We now use API names that speak in terms of credit: receiver.credit, > receiver.add-credit, sender.credit, receiver-options.credit-window > > ## Endpoint properties and methods > > > http://home.apache.org/~jross/pumpjack/core/connection/index.html#endpoint-lifecycle > > - We introduced boolean properties for endpoint states instead of the > endpoint.state bit field > - Endpoint.close takes an optional error-condition > > ## Endpoint options > > http://home.apache.org/~jross/pumpjack/core/connection-options/index.html > http://home.apache.org/~jross/pumpjack/core/session-options/index.html > http://home.apache.org/~jross/pumpjack/core/sender-options/index.html > http://home.apache.org/~jross/pumpjack/core/receiver-options/index.html > > - Connection.virtual-host instead of host, to clarify its purpose versus > the host info supplied in URLs > - Connection.max-sessions instead of max-channels, in order to speak in > user terms, not AMQP spec terms > - Added session-options > - Some 0.12.0 link options will be removed until their status is decided > > ## Data types > > http://home.apache.org/~jross/pumpjack/types/index.html > > - We have dropped the "amqp-" prefixes from type names; if a > language-provided type fits the need, we use that; if the language doesn't > offer one, we can introduce the type without any concern about collisions > - We will use string, not the URL class, as the first-class representation > of a URL in API signatures; we will continue to use the URL class directly > in our examples to simplify simple parsing jobs > > ## Future plans > > We have either already made or will be making these changes for Proton > 0.13.0. The amount of outstanding work may require a Proton release delay. > > As with 0.12.0, not all parts of the API will be declared stable at that > point. Specifically: > > - We will mark some elements of the API experimental and subject to > change; for instance, the IO and codec namespaces will remain experimental > - We will mark some elements internal (and thus not exposed in API docs) > until we are confident they are ready for broader use > > Apart from these exclusions, however, we will be supporting the Proton > 0.13.0 C++ core and data types as stable API going forward. > > Please give us your thoughts on the proposed API. We'll do our best to > explain our thinking or adapt it. > > Thanks, > Justin > --001a113cd9a6b924f70530895aba--