<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm a bit partial to option 2 since that is how we do it in JS, &nbsp;however; there is a pattern in node where there is one callback that is passed an error argument( if available ). &nbsp;something like this gist<div><a href="https://gist.github.com/lholmquist/7023904">https://gist.github.com/lholmquist/7023904</a></div><div><br></div><div>although either way, we are determining what is an error<br><div><div>On Oct 17, 2013, at 7:25 AM, Apostolos Emmanouilidis &lt;<a href="mailto:aemmanou@redhat.com">aemmanou@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">


  <meta http-equiv="Content-Type" content="text/html; CHARSET=UTF-8">
  <meta name="GENERATOR" content="GtkHTML/4.6.4">

<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'm wondering how we want the Callback to be. I see 2 options that are described here :&nbsp;<a href="https://gist.github.com/sebastienblanc/7023151">https://gist.github.com/sebastienblanc/7023151</a>
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Basically, version 1 has a 'completed' method which will be invoked no matter which http status code is returned, the&nbsp;developer&nbsp;has than to implement it's own logic of handling the status. The 'failure' method will be invoked &nbsp;in case of an exception is thrown (IOException for instance)
</blockquote>
<blockquote type="CITE">
    <br>
    <br>
</blockquote>
<blockquote type="CITE">
    Version 2 has a 'onSuccess' method which handles the 2xx response codes and a 'onError' which handles 4xx, 5xx codes or even if an exception has&nbsp;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">scm.blanc@gmail.com</a>&gt; wrote:
</blockquote>
<blockquote type="CITE">
    <blockquote>
        FYI Karel has created a Jira for this&nbsp;<a href="https://issues.jboss.org/browse/AGPUSH-373">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">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">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">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">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; "maybe fire"&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't this land called vert.x?<br>
            &gt; Maybe I misunderstood. &nbsp;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">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a><br>
            &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a><br>
            &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a><br>
            <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">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">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></div></body></html>