Add APIs to support .NET generic host #18
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.
Description
Add support for building Munin-Node hosted service integrated with the .NET generic host.
This PR adds a new package/assembly/namespace
Smdn.Net.MuninNode.Hosting
.In this PR, the following key API will be added:
AddHostedMuninNodeService()
: An extension method toIServiceCollection
to registerMuninNodeBackgroundService
, as described below, which runs Munin-Node as a hosted/background service. The service to be registered is configured using the APIs fromSmdn.Net.MuninNode.DependencyInjection
. See Add APIs to support dependency injection #17 for detail.MuninNodeBackgroundService
: The class extendsBackgroundService
to run Munin-Node as a hosted/background service. It holds a configured and builtIMuninNode
, and callsIMuninNode.RunAsync
to start Munin-Node background tasks.An example of using the API to be added is as follows:
Considerations
It is noted that the implementation to be added with this PR is based on ideas proposed in the discussion #11 and PR #12.
This PR is based on #17. It needs to be merged.