Open ichagall opened 7 years ago
@ichagall That is the expected behavior. cancel()
just sets the state, but does not itself call finish()
-- you have to also do that.
EDIT: Looks like PSOperations works differently from the WWDC Operations project. From what I can tell cancel()
does in fact call finish()
-- I think this makes more sense.
override open func cancel() {
stateLock.withCriticalScope {
if isFinished {
return
}
_cancelled = true
if state > .ready {
finish()
}
}
}
You should read the discussion in https://github.com/pluralsight/PSOperations/issues/74 as it is relevant
for the executing operations , call cancel() don't finish the operation really, the method just mark the operations' state as hasFinished and remove the operations from the queue, in fact these operations are still running.