Skip to content

Run lifecycle hook parallelly #1257

Description

@okhowang

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions