feat: add explicit dispose() methods to JSSandbox and LoadedJSSandbox NAPI Wrappers#69
feat: add explicit dispose() methods to JSSandbox and LoadedJSSandbox NAPI Wrappers#69simongdavies wants to merge 1 commit intohyperlight-dev:mainfrom
dispose() methods to JSSandbox and LoadedJSSandbox NAPI Wrappers#69Conversation
dispose() methods to JSSandbox and LoadedJSSandbox NAPI Wrappers
There was a problem hiding this comment.
Pull request overview
Adds explicit dispose() methods to the NAPI-exposed JSSandbox and LoadedJSSandbox wrappers to allow deterministic release of underlying sandbox resources (by take()-ing the inner Option), instead of waiting for GC.
Changes:
- Add
JSSandboxWrapper.dispose()that drops the innerJSSandbox(no-op if already consumed). - Add
LoadedJSSandboxWrapper.dispose()that drops the innerLoadedJSSandbox(no-op if already consumed). - Document the intended post-disposal behavior (
ERR_CONSUMEDon further use).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a005bdb to
92ea9dd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
92ea9dd to
d0fe148
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d0fe148 to
32996b5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… NAPI wrappers Add #[napi] dispose() methods that eagerly release underlying sandbox resources by calling take() on the inner Option. After disposal, all subsequent calls return ERR_CONSUMED. No-op on already-consumed instances. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
32996b5 to
a08f6c4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add #[napi] dispose() methods that eagerly release underlying sandbox resources by calling take() on the inner Option. After disposal, all subsequent calls return ERR_CONSUMED. No-op on already-consumed instances.