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

Run lifecycle hook parallelly #1257

Open
okhowang opened this issue Jan 6, 2025 · 0 comments
Open

Run lifecycle hook parallelly #1257

okhowang opened this issue Jan 6, 2025 · 0 comments

Comments

@okhowang
Copy link

okhowang commented Jan 6, 2025

Is your feature request related to a problem? Please describe.
lifecycle hook is running one by one.
if someone run too long,
the hooks after it may be failed by timeout
because all hooks share same start/stop timeout.

Describe the solution you'd like
hooks are not depend on each other usually.
can we add a option to make hook run in specific parallelism n.
like fx.New(fx.ParallelHooks(n), ...)

Describe alternatives you've considered
I can start a goroutine in hooks to make it run fastly.
but error can't be catched by fx

Is this a breaking change?
No, default is 1
It means no behaviour change with existing code.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants