Skip to content

Conversation

@samuel-williams-shopify
Copy link
Contributor

@samuel-williams-shopify samuel-williams-shopify commented Sep 2, 2025

This PR refactors Task to use Promise for state management, achieving the goal that "a task should be a promise with attached computation and stop (cancellation) handling." The key changes include: moving @status logic into Promise using @resolved with consistent symbol states (:completed, :failed, :cancelled), renaming @finished to @promise, deriving running? state from @fiber&.alive?, and adding sophisticated exception handling to Promise#fulfill with proper non-local exit support. This maintains full backward compatibility while providing cleaner state management, comprehensive test coverage (47 new Promise tests), and improved code organization with zero breaking changes to the public API.

Types of Changes

  • New feature.
  • Performance improvement.

Contribution

@samuel-williams-shopify samuel-williams-shopify force-pushed the thread-safety-task-wait branch 3 times, most recently from e31ba04 to 5a5b5a5 Compare September 4, 2025 08:12
@ioquatix ioquatix merged commit cf7fce1 into main Sep 4, 2025
73 of 79 checks passed
@ioquatix ioquatix deleted the thread-safety-task-wait branch September 4, 2025 08:38
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