-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from EventStore/subsystems
Add ISubsystemsPlugin as a way to plugably create subsystems
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace EventStore.Plugins.Subsystems; | ||
|
||
public interface ISubsystem { | ||
IApplicationBuilder Configure(IApplicationBuilder builder); | ||
IServiceCollection ConfigureServices(IServiceCollection services); | ||
IEnumerable<Task> Start(); | ||
void Stop(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace EventStore.Plugins.Subsystems; | ||
|
||
public interface ISubsystemFactory<TArg> { | ||
ISubsystem Create(TArg arg); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace EventStore.Plugins.Subsystems; | ||
|
||
// A plugin that can create multiple subsystems. | ||
// A TArg is required to produce each subsystem from its respective factory. | ||
public interface ISubsystemsPlugin<TArg> { | ||
string Name { get; } | ||
string Version { get; } | ||
string CommandLineName { get; } | ||
IEnumerable<ISubsystemFactory<TArg>> GetSubsystemFactories(string configPath); | ||
} |