Hi there,

on iOS, there is a built-in method in the underlying AFNetworking library that cancels *all* requests pending (in our case on the same Pipe). I can go ahead and patch AFNetworking to have some association with request and ids, but I really don't want to go to that path cause we need to maintain our own version of AFNetworking.

-
Christos

On Feb 11, 2013, at 5:39 PM, Kris Borchers <kris@redhat.com> wrote:

I was going to bring up a similar discussion so I will just comment inline.

On Feb 11, 2013, at 9:12 AM, Summers Pittman <supittma@redhat.com> wrote:

We have three JIRA's[1] to add a cancel method to Pipe.

In Android (and presumably iOS and to a lesser extent JS) Pipes are shared among multiple threads and each request exists in its own scope.  (IE multiple threads can have multiple requests running at one time).

When a "cancel" is called, which request is cancelled?

This is the exact issue I was going to bring up. Since JS uses promises, the straight forward way to cancel the request is to call the abort() method already available in the jqXHR returned by a call to read(), save(), remove(). That said, I would really rather not add a method to JS for this since it would be nothing more than an extra layer around that abort method, and also not something that would be available on the pipe itself but the object returned by a call to one of its methods.

Another issue is that it would need to be clearly documented that calling cancel() (or abort() or what ever) has no effect on the server so if you do a save() or remove() and then call cancel(), that action will still take place on the the server.
 I've attempted to address this (and some larger issues) here: https://github.com/aerogear/aerogear.org/blob/pipe_spec/docs/specs/aerogear-client-pipe/index.markdown


Summers

1: (898,901,895)
_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev