Skip to content
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

on-exit-leak-free, copy or move to core? #10

Closed
H4ad opened this issue May 30, 2024 · 4 comments
Closed

on-exit-leak-free, copy or move to core? #10

H4ad opened this issue May 30, 2024 · 4 comments

Comments

@H4ad
Copy link
Owner

H4ad commented May 30, 2024

@mcollina What do you think? That module sounds very useful to have on core, the simplicity makes me want to copy the code but I think we could just expose that as a wrapper for FinalizationRegistry.

We have some issues with the registry but it was solved, the crashes were also fixed by legendas, so maybe we can rely again on this feature.

We probably could expose those functions inside process, maybe something like:

process.registerOnExit(obj, fn);
process.registerBeforeOnExit(obj, fn)
@mcollina
Copy link

nodejs/node#48058 < There was quite a lot of objections in bringing this in.

You might want to open that again.

I think those two functions would be incredibly useful for the ecosystem.

@H4ad
Copy link
Owner Author

H4ad commented May 30, 2024

Instead of re-opening the issue, I will create a PR to introduce those two functions as I mentioned earlier, feel free to suggest other API Design instead of those I suggested.

I think with a PR, we will move faster than trying to wait for comments on an issue.

@mcollina
Copy link

let's do it

@H4ad
Copy link
Owner Author

H4ad commented Jan 18, 2025

Closed since we merged this to core.

@H4ad H4ad closed this as completed Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants