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

Strict Future value #471

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Strict Future value #471

wants to merge 1 commit into from

Conversation

arnetheduck
Copy link
Member

@arnetheduck arnetheduck commented Nov 15, 2023

Strict future access is now always enabled, making it a panic to access value/error when the Future is still pending - read and readError raise catchable exceptions instead which may be preferable to use.

  • remove chronosStrictFutureAccess enabling its functionality by default
  • disallow setting a cancellation callback on a non-pending future

@arnetheduck arnetheduck marked this pull request as draft November 17, 2023 09:38
@arnetheduck
Copy link
Member Author

This PR is marked draft to better investigate the consequences of Defect on error - in particular, if fut.error == nil is a somewhat established idiom to check if the future failed even though accessors like failed exist for this purpose.

@arnetheduck
Copy link
Member Author

#474 contains the changes unrelated to the new Defect

Strict future access is now always enabled, making it a panic to access
value/error when the Future is still pending - `read` and `readError`
raise catchable exceptions instead which may be preferable to use.

* remove `chronosStrictFutureAccess` enabling its functionality by
default
* disallow setting a cancellation callback on a non-pending future
@arnetheduck arnetheduck changed the title Strict Future value / error access and related fixes Strict Future value Nov 17, 2023
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.

1 participant