Expose package-owned worker jobs - #572
Draft
peter-jerry-ye wants to merge 1 commit into
Draft
Conversation
Coverage Report for CI Build 1080Coverage decreased (-0.02%) to 76.954%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
peter-jerry-ye
force-pushed
the
codex/package-owned-job
branch
from
August 25, 2026 07:29
3938b39 to
65526cf
Compare
peter-jerry-ye
force-pushed
the
codex/package-owned-job
branch
2 times, most recently
from
August 25, 2026 08:36
60a0774 to
f5dfe57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Packages outside
asyncneed to offload blocking native or runtime work without duplicating event-loop notification and worker-pool lifecycle. The existing job type is internal, so those packages cannot submit their own opaque jobs through the shared scheduler.What
moonbitlang/async/jobpackage exposing an opaque, target-specificJoband awith_jobsubmission interface.Why this shape
The public facade and event loop share the same Job type through a type-only leaf package. Native binding functions can therefore return the scheduler's exact opaque Job type directly, without exposing the event-loop package or requiring a representation cast. Wasm handle lowering remains private to the event-loop implementation.
The event loop learns only about an opaque job. It does not learn package-specific operations, result types, or concurrency policy. Notification, worker lifecycle, cancellation, and completion remain in their existing owners. Resource-specific coordination belongs to the submitting package.