You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, it's not strictly necessary to call reset on a JavaInterfaceProxy. The inner proxy instance is already automatically destroyed once the garbage collector cleans up the JavaInterfaceProxy instance. Calling reset on the instance only speeds up the process as the garbage collector only runs in intervals. This is important if you want your application to exit as fast as possible as any existing interface proxies will prevent your application from closing (although process.exit() will stop the application instantly).
This is kind of documented in the notes of newProxy, but I see where the confusion is coming from. I'll try to clarify this behavior in the docs (in #92).
Closing this issue as this is already implemented and the current implementation doesn't require a new node.js version.
Is your feature request related to a problem? Please describe.
It is important to release
proxy
object when no longer in use. Ex.Typescript 5.2 and Node 20 introduced a new approach known e.g. in Java as try-resource:
Describe the solution you'd like
The implementation requires adding an
Symbol.dispose
alias for thereset
method in theproxy
object.Additional context
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management
https://tc39.es/proposal-explicit-resource-management/
The text was updated successfully, but these errors were encountered: