Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel request by TAG #754

Closed
eGorets opened this issue Dec 7, 2014 · 7 comments
Closed

Cancel request by TAG #754

eGorets opened this issue Dec 7, 2014 · 7 comments
Assignees
Milestone

Comments

@eGorets
Copy link

eGorets commented Dec 7, 2014

I think it would be a good feature for manage queries workflow. Just like in picasso project.

@smarek smarek added this to the 1.5.0 milestone Dec 8, 2014
@smarek smarek self-assigned this Dec 8, 2014
@smarek
Copy link
Member

smarek commented Dec 8, 2014

Thank you, that's actually neat idea, I'm keeping it as feature request into 1.5 branch.

@andrewchen5678
Copy link

OkHttp and Volley all has this feature but not here.

@smarek smarek modified the milestones: 1.4.8, 1.5.0 Jul 16, 2015
@smarek
Copy link
Member

smarek commented Jul 16, 2015

Provided, can you please review ? @andrewchen5678 @eGorets
Will be released with version 1.4.8

Implementation: 8b1243c
Sample usage: CancelRequestByTagSample.java

@smarek smarek closed this as completed Jul 16, 2015
smarek added a commit that referenced this issue Jul 16, 2015
…mplementation, so it can be used as identification of request/response pair, Closing #552
@smarek
Copy link
Member

smarek commented Jul 16, 2015

Also included in latest snapshot uploaded to snapshot repository

@eGorets
Copy link
Author

eGorets commented Jul 20, 2015

@smarek cool, thanks, but in some case I think it would be better to set 'Object' as a TAG, for example, in activity we can use 'setTag(this)' and 'cancelQueriesByTag(this)' in lifecycle methods without String tags.

@smarek
Copy link
Member

smarek commented Jul 20, 2015

@eGorets that's what the purpose of Context as first param of every AsyncHttpClient call is. You pass the context, and then you can cancel requests for context using cancelRequests(final Context context, final boolean mayInterruptIfRunning) (here: https://github.com/loopj/android-async-http/blob/master/library/src/main/java/com/loopj/android/http/AsyncHttpClient.java#L760 )

@eGorets
Copy link
Author

eGorets commented Jul 20, 2015

@smarek oh, sorry, you are right. This is a really good job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants