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 should not call finish, should it? #74

Open
t089 opened this issue Aug 12, 2016 · 7 comments
Open

cancel should not call finish, should it? #74

t089 opened this issue Aug 12, 2016 · 7 comments

Comments

@t089
Copy link

t089 commented Aug 12, 2016

I am a bit surprised to see that the cancel implementation of Operation calls finish by itself, if state > .Ready. Shouldn't cancel only mark the operation as cancelled ? Isn't it the responsibility of the operation to check for this flag, and if true, stop its work, clean up and only then transition to the finished state? Or am I missing something?

@jcarroll-mediafly
Copy link

Yeah, I struggled with this a bit myself. Especially when using group operations and dealing with race conditions.

If you haven't seen my reported issue I would like to hear other's thoughts on it. Shameless plug for advice :D

#69

@MarkQSchultz
Copy link
Contributor

@t089 I agree. This was pointed out quite a while ago too. One of the reasons we haven't changed it yet is that it's a pretty big breaking change.

@t089
Copy link
Author

t089 commented Aug 12, 2016

Ok, well I guess it is a big change, but it is also quite a big mistake in the implementation. In its current form a call to cancel will immediately fire the completion observers and clients would think that the op finished its work, while in reality it might still be very busy and do stuff. Even worse, when it is done it can't call the didFinish observer again because it already fired.

@MarkQSchultz
Copy link
Contributor

You do realize that I already said that I agree with you, right? Not sure the point of most of that comment...

@t089
Copy link
Author

t089 commented Aug 12, 2016

Yup just wanted to add some more arguments pro change. Sorry if you feel it was redundant.

You do realize that I already said that I agree with you, right? Not sure the point of most of that comment...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@MarkQSchultz
Copy link
Contributor

👍This would be a good change. Just a big one at this point. That's all. I would want to version the framework on this change though, as it is a breaking change.

@priteshshah1983
Copy link

priteshshah1983 commented Jun 17, 2017

It doesn't look like this change was ever made (or merged). Can you please confirm?

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

No branches or pull requests

4 participants