<div dir="ltr">We could also propose both in the same callback, a bit ala JavaScript : meaning offering also an &#39;onSuccess&#39; (for 2xx) with still the &#39;complete&#39; which will be called anyway. Could be a nice convenience method for slackers.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 2:20 PM, Lucas Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I&#39;m a bit partial to option 2 since that is how we do it in JS,  however; there is a pattern in node where there is one callback that is passed an error argument( if available ).  something like this gist<div>
<a href="https://gist.github.com/lholmquist/7023904" target="_blank">https://gist.github.com/lholmquist/7023904</a></div><div><br></div><div>although either way, we are determining what is an error<div><div class="h5"><br>
<div><div>On Oct 17, 2013, at 7:25 AM, Apostolos Emmanouilidis &lt;<a href="mailto:aemmanou@redhat.com" target="_blank">aemmanou@redhat.com</a>&gt; wrote:</div><br><blockquote type="cite">


  
  

<div>
+ 1 on letting the client decide what status is considered as success (version 1)<br>
<br>
On Thu, 2013-10-17 at 13:21 +0200, Sebastien Blanc wrote:
<blockquote type="CITE">
    So I started to look more closely to this, and I&#39;m wondering how we want the Callback to be. I see 2 options that are described here : <a href="https://gist.github.com/sebastienblanc/7023151" target="_blank">https://gist.github.com/sebastienblanc/7023151</a>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Basically, version 1 has a &#39;completed&#39; method which will be invoked no matter which http status code is returned, the developer has than to implement it&#39;s own logic of handling the status. The &#39;failure&#39; method will be invoked  in case of an exception is thrown (IOException for instance)
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Version 2 has a &#39;onSuccess&#39; method which handles the 2xx response codes and a &#39;onError&#39; which handles 4xx, 5xx codes or even if an exception has occurred.
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Do you have any preference or even an alternative solution ?
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Seb
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    <br>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    On Tue, Oct 8, 2013 at 3:14 PM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>&gt; wrote:
</blockquote>
<blockquote type="CITE">
    <blockquote>
        FYI Karel has created a Jira for this <a href="https://issues.jboss.org/browse/AGPUSH-373" target="_blank">https://issues.jboss.org/browse/AGPUSH-373</a>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <br>
        <br>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <br>
        <br>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        On Tue, Sep 24, 2013 at 11:43 AM, Karel Piwko &lt;<a href="mailto:kpiwko@redhat.com" target="_blank">kpiwko@redhat.com</a>&gt; wrote:<br>
        <blockquote>
            On Thu, 19 Sep 2013 10:13:52 -0400
        </blockquote>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <blockquote>
            Summers Pittman &lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt; wrote:<br>
            <br>
            &gt; On 09/18/2013 09:37 AM, Karel Piwko wrote:<br>
            &gt; &gt; On Wed, 18 Sep 2013 09:31:36 -0400<br>
            &gt; &gt; Summers Pittman &lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt; wrote:<br>
            &gt; &gt;<br>
            &gt; &gt;&gt; On 09/17/2013 11:17 AM, Karel Piwko wrote:<br>
            &gt; &gt;&gt;&gt; Hi,<br>
            &gt; &gt;&gt;&gt;<br>
            &gt; &gt;&gt;&gt; I went once again through<br>
            &gt; &gt;&gt;&gt; <a href="http://lists.jboss.org/pipermail/aerogear-dev/2013-June/002901.html" target="_blank">http://lists.jboss.org/pipermail/aerogear-dev/2013-June/002901.html</a> -<br>
            &gt; &gt;&gt;&gt; which says that Sender API should be fire&amp;forget. It feels more like<br>
            &gt; &gt;&gt;&gt; &quot;maybe fire&quot;&amp;forget, for instance it does not say that your credentials<br>
            &gt; &gt;&gt;&gt; were wrong<br>
            &gt; &gt;&gt;&gt; - or it says, you need parse logs to get that information.<br>
            &gt; &gt;&gt;&gt;<br>
            &gt; &gt;&gt;&gt; If I think about Android, iOS, JS solutions to communicate with<br>
            &gt; &gt;&gt;&gt; UnifiedPush we provide - Pipes - they always provide a callback to be<br>
            &gt; &gt;&gt;&gt; executed on success/failure. Could we add callback to Sender API? Or<br>
            &gt; &gt;&gt;&gt; should not Aerogear rather have something like Pipes abstraction for Java<br>
            &gt; &gt;&gt;&gt; developers instead of pretty dumb Sender API?<br>
            &gt; &gt;&gt;&gt;<br>
            &gt; &gt;&gt;&gt; Thoughts?<br>
            &gt; &gt;&gt; In a bit of crazy land perhaps the client could keep a web socket or BSD<br>
            &gt; &gt;&gt; Socket open to the server which would let it get callbacks about things<br>
            &gt; &gt;&gt; that happen further down the tree.<br>
            &gt; &gt; Isn&#39;t this land called vert.x?<br>
            &gt; Maybe I misunderstood.  I thought it was wanting to get information from<br>
            &gt; the push server about the status of messages being sent not the response<br>
            &gt; of the commands to the push server itself.<br>
            <br>
            <br>
        </blockquote>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <blockquote>
            I was speaking about the latter.
        </blockquote>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <blockquote>
            <br>
            &gt; &gt;<br>
            &gt; &gt;&gt;&gt; Thanks,<br>
            &gt; &gt;&gt;&gt;<br>
            &gt; &gt;&gt;&gt; Karel<br>
            &gt; &gt;&gt;&gt; _______________________________________________<br>
            &gt; &gt;&gt;&gt; aerogear-dev mailing list<br>
            &gt; &gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
            &gt; &gt;&gt; _______________________________________________<br>
            &gt; &gt;&gt; aerogear-dev mailing list<br>
            &gt; &gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
            &gt; &gt; _______________________________________________<br>
            &gt; &gt; aerogear-dev mailing list<br>
            &gt; &gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
            &gt;<br>
            &gt; _______________________________________________<br>
            &gt; aerogear-dev mailing list<br>
            &gt; <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
            &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
            <br>
            _______________________________________________<br>
            aerogear-dev mailing list<br>
            <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
            <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
            <br>
        </blockquote>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <blockquote>
        <br>
        <br>
    </blockquote>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
<pre>_______________________________________________
aerogear-dev mailing list
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a>
</pre>
</blockquote>
<br>
</div>

_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></blockquote>
</div><br></div></div></div></div><br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div>