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
Is your feature request related to a problem? Please describe.
Our service has a few dozen dependencies of various complexity. As part of initializing some of them, we'll 'ping' the API in question so that the service can fail fast if something is wrong (e.g. auth or some other configuration). Doing all of these serially means our service takes several seconds to start up, which is noticeable when using 'serverless' systems that scale down to zero, like GCP's Cloud Run.
Describe the solution you'd like
I'd like wire to generate code that parallelizes initialization when possible, e.g.:
Is your feature request related to a problem? Please describe.
Our service has a few dozen dependencies of various complexity. As part of initializing some of them, we'll 'ping' the API in question so that the service can fail fast if something is wrong (e.g. auth or some other configuration). Doing all of these serially means our service takes several seconds to start up, which is noticeable when using 'serverless' systems that scale down to zero, like GCP's Cloud Run.
Describe the solution you'd like
I'd like wire to generate code that parallelizes initialization when possible, e.g.:
(Note: I recognize this contrived example ignores nested things and error-handling, which make this slightly more complicated)
And tangentially, but usefully, each provider could be wrapped in a sync.Once and cached.
Describe alternatives you've considered
The caching can be built into the provider itself by doing something like:
But the async/concurrent bit can't be done natively, as far as I know.
The text was updated successfully, but these errors were encountered: