Skip to content

Only allow a single Future setter to be called#240

Merged
jodal merged 2 commits intomainfrom
single-set-future
Sep 7, 2025
Merged

Only allow a single Future setter to be called#240
jodal merged 2 commits intomainfrom
single-set-future

Conversation

@jodal
Copy link
Copy Markdown
Owner

@jodal jodal commented Sep 7, 2025

We already raised an exception if multiple calls to .set() and .set_exception() were done on a single future. Now, the same behavior applies to .set_get_hook().

This may be a breaking change if you use Future.set_get_hook() directly. If you only use it indirectly via Future.map(), .join(), and .reduce(), there is no change, as these have always created new futures with the get hook, wrapping the futures with the results to transform.

Closes #235

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.84%. Comparing base (8bd6470) to head (1b752a0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   93.47%   93.84%   +0.37%     
==========================================
  Files          14       14              
  Lines         567      569       +2     
  Branches       49       50       +1     
==========================================
+ Hits          530      534       +4     
+ Misses         32       31       -1     
+ Partials        5        4       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jodal jodal merged commit b58ed3e into main Sep 7, 2025
13 checks passed
@jodal jodal deleted the single-set-future branch September 7, 2025 08:02
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