Add Support For Generic Handlers With Multiple Generic Type Parameters #1048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for handlers that contain multiple generic type parameters.
This PR is a direct fix for issues #1047 and #1038
Example:
The issue that this PR solves was caused from only attempting to close the first type parameter in a generic request handler implementation.
This PR fixes that by finding the types that close for all type parameter and storing those in a list of lists. Then all possible combinations of concrete implementations are generated from the lists and registered with the service provider.
Something that might need some discussion and thought will be what kinds of limitations we should put around this feature so that users are not misusing the library and creating a deadlock during service registration.
Along with this PR I added these configuration options with default values to the Configuraton object..
For now these are the default values, but I would like some feedback regarding these values.
I've also added some pretty extensive test methods that confirm this is working as expected.
@jbogard , @hisuwh Please review this at your convenience.
Thanks,
Edit: I apologize for not getting this done sooner.. I have just started a new job and haven't had the time. :)
Edit: Added an opt out functionality.