Skip to content

Commit

Permalink
Reduce subsystem interface implementation requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
pvanbuijtene committed Jan 11, 2024
1 parent 1a587a3 commit ef0daa9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/EventStore.Plugins/Subsystems/ISubsystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

Expand All @@ -8,6 +7,6 @@ namespace EventStore.Plugins.Subsystems;
public interface ISubsystem {
IApplicationBuilder Configure(IApplicationBuilder builder);
IServiceCollection ConfigureServices(IServiceCollection services);
IReadOnlyList<Task> Start();
void Stop();
Task Start();
Task Stop();
}
4 changes: 2 additions & 2 deletions src/EventStore.Plugins/Subsystems/ISubsystemFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace EventStore.Plugins.Subsystems;

public interface ISubsystemFactory<TArg> {
ISubsystem Create(TArg arg);
public interface ISubsystemFactory {
ISubsystem Create();
}
5 changes: 2 additions & 3 deletions src/EventStore.Plugins/Subsystems/ISubsystemsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
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> {
public interface ISubsystemsPlugin {
string Name { get; }
string Version { get; }
string CommandLineName { get; }
IReadOnlyList<ISubsystemFactory<TArg>> GetSubsystemFactories(string configPath);
IReadOnlyList<ISubsystemFactory> GetSubsystemFactories(string configPath);
}

0 comments on commit ef0daa9

Please sign in to comment.