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

Expose resolveProxyProvider function as we expose resolveProxyProviders #130

Closed
jpamorimdev opened this issue Mar 20, 2024 · 7 comments · Fixed by #131
Closed

Expose resolveProxyProvider function as we expose resolveProxyProviders #130

jpamorimdev opened this issue Mar 20, 2024 · 7 comments · Fixed by #131
Labels
enhancement New feature or request

Comments

@jpamorimdev
Copy link

Is it possible to expose resolveProxyProvider as we expose resolveProxyProviders? It gives us the flexibility of resolving the providers properly when needed.

@Papooch
Copy link
Owner

Papooch commented Mar 20, 2024

I had that idea in my mind for a while, too. Do you mean resolving proxy providers individually?

I think it could work if we added an array of proxy provider injection tokens as an array to the resolveProxyProviders method, which would only resolve those that were supplied. If none are passed, then resolve all that have not been resolved yet. Would that work for your use case?

@jpamorimdev
Copy link
Author

Exactly! That would work perfectly.

const provider1 = 'PROVIDER_1'
const provider2 = 'PROVIDER_2'
const provider3 = 'PROVIDER_3'
const provider4 = 'PROVIDER_4'

// some business logic..
// should resolve only provider1
clsService.resolveProxyProviders([provider1])

// some business logic..
// should resolve only provider2
clsService.resolveProxyProviders([provider2])

// some business logic..
// should resolve all unresolved providers(aka provider3 and provider4)
clsService.resolveProxyProviders()

@jpamorimdev
Copy link
Author

I think another good improvement together with this would be an options param for resolveProxyProviders where we could pass something like force as boolean and it would ignore the piece of code where it checks if the provider already exists in the CLS it could be useful in some scenarios.

@Papooch
Copy link
Owner

Papooch commented Mar 21, 2024

it could be useful in some scenarios

I'm not a fan of adding features unless they solve a concrete problem. Let's start with selective resolution of proxy providers only.

@Papooch Papooch added the enhancement New feature or request label Mar 21, 2024
@jpamorimdev
Copy link
Author

it could be useful in some scenarios

I'm not a fan of adding features unless they solve a concrete problem. Let's start with selective resolution of proxy providers only.

I see, same, just thought as it'll be useful to follow DRY while I add cronjobs that will run for every tenant db but no worries about that for now.

Btw I appreciate the enhancement of resolving proxy providers individually

@Papooch
Copy link
Owner

Papooch commented Mar 23, 2024

Released in 4.3.0

@jpamorimdev
Copy link
Author

Released in 4.3.0

Awesome, thanks for the update!

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

Successfully merging a pull request may close this issue.

2 participants