Repository navigation
Add Queue.shutdownUnsafe for synchronous teardown - #8318
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: cdd99b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
tim-smart
approved these changes
Sep 20, 2026
Merged
arrudaricardo
pushed a commit
to arrudaricardo/effect
that referenced
this pull request
Sep 23, 2026
Co-authored-by: Tim Smart <hello@timsmart.co>
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.
Adds
Queue.shutdownUnsafefor native callbacks that must synchronously discard buffered messages and settle waiting operations before returning. Datagram socket teardown needs this ordering before potentially slow native cleanup; the datagram implementation remains in #8265.The new API performs Queue shutdown synchronously.
Queue.shutdowndelegates to it insideEffect.sync. Both functions returntruewhen the call performs teardown andfalsewhen the queue has already been shut down or completed. This changesQueue.shutdown, which previously returnedtrueunconditionally.An open queue shuts down with interruption, while an already-closing queue retains its completion cause. Shutdown releases blocked producers and discards buffered storage immediately.
This PR contains the Queue implementation, focused tests for synchronous settlement, cleanup, failure preservation, repeated shutdown, and the
effectchangeset.Validation:
pnpm test --run packages/effect/test/Queue.test.ts: 50 tests passed.pnpm doctest --run packages/effect/src/Queue.ts: 35 tests passed.pnpm checkandpnpm lint: passed.Closes EFF-1427