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

Add proper support for injecting proxy providers into other proxy providers #169

Open
Papooch opened this issue Jul 26, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@Papooch
Copy link
Owner

Papooch commented Jul 26, 2024

Currently, only the built-in CLS_REQ and CLS_RES proxy providers are able to be injected in other proxy providers.

There is only a partial support for injecting custom proxy providers with some manual work by calling await cls.resolveProxyProviders(TheOtherProvider) in proxy provider factories when they depend on other proxy providers and their value is needed at the time of construction.

There is no support for this workflow in class proxy providers, because the constructor must be synchronous, but resolving proxy providers is an asynchronous operation.


Solution: when resolving proxy providers, scan their dependency array for other proxy providers and resolve those first. That should ensure that dependent proxy providers are always resolved when needed in other proxy providers.

@Papooch Papooch added the enhancement New feature or request label Jul 26, 2024
@Papooch Papooch changed the title Add support for injecting proxy providers into other proxy providers Add proper support for injecting proxy providers into other proxy providers Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant