-
Notifications
You must be signed in to change notification settings - Fork 103
cancel should not call finish, should it? #74
Comments
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 |
@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. |
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. |
You do realize that I already said that I agree with you, right? Not sure the point of most of that comment... |
Yup just wanted to add some more arguments pro change. Sorry if you feel it was redundant.
|
👍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. |
It doesn't look like this change was ever made (or merged). Can you please confirm? |
I am a bit surprised to see that the
cancel
implementation ofOperation
callsfinish
by itself, ifstate > .Ready
. Shouldn'tcancel
only mark the operation as cancelled ? Isn't it the responsibility of the operation to check for this flag, and iftrue
, stop its work, clean up and only then transition to thefinished
state? Or am I missing something?The text was updated successfully, but these errors were encountered: