Skip to content

Implementation of URLSessionTask.cancel() #689

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

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

pushkarnk
Copy link
Member

No description provided.

@pushkarnk
Copy link
Member Author

@swift-ci please test

s.delegateQueue.addOperation {
delegate.urlSession(s, task: self, didCompleteWithError: NSError(domain: NSURLErrorDomain, code: NSURLErrorCancelled, userInfo: nil))
self.internalState = .taskCompleted
}
Copy link
Contributor

@naithar naithar Nov 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't a call of completeTask(withError:) cover all situations when there is a need to perform a task completion? Or .cancel() should only call URLSession:task:didCompleteWithError: on delegate and not call any other callbacks?

@pushkarnk
Copy link
Member Author

@swift-ci please test

@pushkarnk
Copy link
Member Author

@naithar Thanks for the suggestion. Can you please review?

@naithar
Copy link
Contributor

naithar commented Feb 14, 2017

Looks good to me. :)

@pushkarnk
Copy link
Member Author

@parkera Can you please review? Thanks.

@parkera
Copy link
Contributor

parkera commented Feb 15, 2017

Looks reasonable to me.

@pushkarnk
Copy link
Member Author

pushkarnk commented Feb 15, 2017

Thanks.

@pushkarnk
Copy link
Member Author

@swift-ci please test and merge

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

Successfully merging this pull request may close these issues.

4 participants