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

Checking if a block has been cancelled immediately before it runs #35

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

plivesey
Copy link
Owner

No description provided.

Peter Livesey and others added 2 commits September 14, 2016 13:37
@plivesey
Copy link
Owner Author

Sadly, I'm unable to work out how to write a unit test for this because cancelAllOperations isn't barrier safe. As in, it will cancel them, but not right now (in the near future).

@@ -755,6 +755,10 @@ public class ConsistencyManager {
// Default to true if weakOperation is nil
return weakOperation?.cancelled ?? true
}
// Let's check here to see if it's cancelled before we start
if cancelled() {

Choose a reason for hiding this comment

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

super-minor: instead of cancelled() here, I'd put () at the end of the { } block above, so you can just say if cancelled

Copy link
Owner Author

Choose a reason for hiding this comment

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

Can't do that because I pass the cancelled block into the next function.
I actually need that closure.

Choose a reason for hiding this comment

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

ah my bad 👍

Copy link

@oliverhu oliverhu left a comment

Choose a reason for hiding this comment

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

lgtm

@cezarywojcik
Copy link

lgtm after minor comment

@plivesey plivesey merged commit af57cf3 into master Sep 14, 2016
@plivesey plivesey deleted the queuefix branch September 14, 2016 20:57
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.

3 participants