-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Explicit Resource Management #1830
Merged
Merged
Conversation
This file contains 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
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@whatwg-node/node-fetch |
0.7.4-alpha-20241125142132-d9f044a9ea5bb1f5c81f5bc09c613fdd5be81281 |
npm ↗︎ unpkg ↗︎ |
@whatwg-node/server |
0.10.0-alpha-20241125142132-d9f044a9ea5bb1f5c81f5bc09c613fdd5be81281 |
npm ↗︎ unpkg ↗︎ |
@whatwg-node/server-plugin-cookies |
2.0.0-alpha-20241125142132-d9f044a9ea5bb1f5c81f5bc09c613fdd5be81281 |
npm ↗︎ unpkg ↗︎ |
✅
|
✅
|
✅
|
✅
|
✅
|
ardatan
changed the title
New disposal logic for server adapter
Explicit Resource Management
Nov 23, 2024
ardatan
added a commit
that referenced
this pull request
Nov 25, 2024
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.
New Explicit Resource Management feature for the server adapters;
Learn more
Symbol.dispose
andSymbol.asyncDispose
hooksWhen the server adapter plugin has these hooks, it is added to the disposable stack of the server adapter. When the server adapter is disposed, those hooks are triggered
disposableStack
in the server adapterThe shared disposable stack that will be triggered when
Symbol.asyncDispose
is called.Even if the server adapter is not disposed explicitly, the disposal logic will be triggered on the process termination (SIGINT, SIGTERM etc)
If it is an environment does not natively provide
waitUntil
, the unresolved passed promises will be resolved by the disposable stack.All ongoing request signals are kept in the disposable stack so when the request adapter is terminated, the requests are automatically terminated as well.