<div dir="ltr">We could also propose both in the same callback, a bit ala JavaScript : meaning offering also an 'onSuccess' (for 2xx) with still the 'complete' 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"><<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>></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'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 <<a href="mailto:aemmanou@redhat.com" target="_blank">aemmanou@redhat.com</a>> 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'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 'completed' method which will be invoked no matter which http status code is returned, the developer has than to implement it's own logic of handling the status. The 'failure' 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 'onSuccess' method which handles the 2xx response codes and a 'onError' 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 <<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>> 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 <<a href="mailto:kpiwko@redhat.com" target="_blank">kpiwko@redhat.com</a>> wrote:<br>
<blockquote>
On Thu, 19 Sep 2013 10:13:52 -0400
</blockquote>
</blockquote>
</blockquote>
<blockquote type="CITE">
<blockquote>
<blockquote>
Summers Pittman <<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>> wrote:<br>
<br>
> On 09/18/2013 09:37 AM, Karel Piwko wrote:<br>
> > On Wed, 18 Sep 2013 09:31:36 -0400<br>
> > Summers Pittman <<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>> wrote:<br>
> ><br>
> >> On 09/17/2013 11:17 AM, Karel Piwko wrote:<br>
> >>> Hi,<br>
> >>><br>
> >>> I went once again through<br>
> >>> <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>
> >>> which says that Sender API should be fire&forget. It feels more like<br>
> >>> "maybe fire"&forget, for instance it does not say that your credentials<br>
> >>> were wrong<br>
> >>> - or it says, you need parse logs to get that information.<br>
> >>><br>
> >>> If I think about Android, iOS, JS solutions to communicate with<br>
> >>> UnifiedPush we provide - Pipes - they always provide a callback to be<br>
> >>> executed on success/failure. Could we add callback to Sender API? Or<br>
> >>> should not Aerogear rather have something like Pipes abstraction for Java<br>
> >>> developers instead of pretty dumb Sender API?<br>
> >>><br>
> >>> Thoughts?<br>
> >> In a bit of crazy land perhaps the client could keep a web socket or BSD<br>
> >> Socket open to the server which would let it get callbacks about things<br>
> >> that happen further down the tree.<br>
> > Isn't this land called vert.x?<br>
> Maybe I misunderstood. I thought it was wanting to get information from<br>
> the push server about the status of messages being sent not the response<br>
> 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>
> ><br>
> >>> Thanks,<br>
> >>><br>
> >>> Karel<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>
> >> 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>
> > 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>
> _______________________________________________<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>
_______________________________________________<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>