Async LightInject: adding async CompositionRoots#256
Open
moswald wants to merge 2 commits intoseesharper:masterfrom
Open
Async LightInject: adding async CompositionRoots#256moswald wants to merge 2 commits intoseesharper:masterfrom
moswald wants to merge 2 commits intoseesharper:masterfrom
Conversation
Owner
|
Looks great. I have just one question though. Given that we are talking about a web application with a startup class or a console application with a main method, how should the RegisterFromAsync method be invoked without doing somthing like Most .Net applications does not support async initialization and that is usually where we put the initialization code for the container. |
Author
|
Sorry, I've been a bit under the weather and haven't been paying attention to github stuff the past few days. In my specific case that spawned this PR, I've got a console-like app that spawns an async service in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is going to be the first of a series of Pull Requests to enable asynchronous initialization of the LightInject
ServiceContainer.This first one is a small step, adding an asynchronous version of
RegisterFrom, as that touches the least amount of code, causes no breaking changes, and covers what is (if I were to guess) the most common case.RegisterFromAsync<TAsyncCompositionRoot>()is a counterpart to the currentRegisterFrom<TCompositionRoot>().TAsyncCompositionRootis a type that must derive from the newIAsyncCompositionRoot.