Skip to content

Conversation

@re-xyr
Copy link

@re-xyr re-xyr commented Dec 6, 2025

Fixes #1209.

Unparker::unpark_with_result() is like Unpark::unpark(), but also returns the previous state of the token. This change also introduces one new public enum UnparkResult.

Some other questions to think about:

  • This is deliberately a non-breaking change. If we think that in the long term, it is better to migrate unpark to returning a result altogether, then making that breaking change here and now could be less painful than adding an alternative method, migrate the main method, and finally deprecate the alternative method, which is two breaking changes.
  • Naming: unpark_with_result sounds a bit awkward. I can think of unpark_returning as an alternative, but it sounds as awkward.

@re-xyr re-xyr force-pushed the unpark-with-result branch from 440311e to 3c170bd Compare December 6, 2025 02:54
@re-xyr re-xyr changed the title Implement Unparker::unparker_with_result() Implement Unparker::unpark_with_result() Dec 6, 2025
This method is like `Unpark::unpark()`, but also returns the previous state of the token.
This change also introduces one new public enum `UnparkResult`.
@re-xyr re-xyr force-pushed the unpark-with-result branch from 3c170bd to 171c83a Compare December 6, 2025 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Having a version of Unpark::unpark() that returns a status

1 participant