-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Service Singleton? #600
Comments
I understand the desire for service consolidation. Each esbuild process will use the same number of threads as cores, so having multiple ones going isn't the best. It should be possible to do reference-counting with I'm happy to do this change myself since it seems like a pretty simple change. But I can take a PR for it if you were looking forward to writing one. |
Cool :) I was offering just so that I wasn't adding to your plate, but I'm headed to bed & don't want you waiting out of sheer politeness lol. Go for it if you have time. I'll open a PR tomorrow if you didn't get to it yet |
Looks good, thanks! |
Is there a reason why
startService
can't return an existingservice
channel if one has already been created?If it's (now) a matter of breaking changes, could we add a
reuse?: boolean
option?I have a few integrations in the works, and without something like this, I'm tempted to (A) keep everything under one umbrella so that I can pass around my own singleton value; or (B) create a separate "holding" module that creates/shares a singleton to all callers.
Without this, it's fairly easy to end up with 2-4 esbuild processes running at the same time.
(Can PR)
The text was updated successfully, but these errors were encountered: