From 6f5ed932fec282d071c63c89ca8f60aefe74130d Mon Sep 17 00:00:00 2001 From: Frank Haugen Date: Fri, 15 Dec 2023 11:12:27 +0100 Subject: [PATCH] Renamed IPulseFlow.cs to IFlow and all related names --- Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs | 2 +- .../{PulseFlowBuilder.cs => FlowBuilder.cs} | 8 ++++---- Frank.PulseFlow/{IPulseFlow.cs => IFlow.cs} | 4 ++-- Frank.PulseFlow/IFlowBuilder.cs | 11 +++++++++++ Frank.PulseFlow/IPulseFlowBuilder.cs | 11 ----------- Frank.PulseFlow/Internal/PulseNexus.cs | 4 ++-- Frank.PulseFlow/ServiceCollectionExtensions.cs | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) rename Frank.PulseFlow/{PulseFlowBuilder.cs => FlowBuilder.cs} (65%) rename Frank.PulseFlow/{IPulseFlow.cs => IFlow.cs} (90%) create mode 100644 Frank.PulseFlow/IFlowBuilder.cs delete mode 100644 Frank.PulseFlow/IPulseFlowBuilder.cs diff --git a/Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs b/Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs index 75a8036..a0c8f5f 100644 --- a/Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs +++ b/Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs @@ -1,6 +1,6 @@ namespace Frank.PulseFlow.Tests.Cli; -public class TextPulseFlow : IPulseFlow +public class TextPulseFlow : IFlow { private readonly ILogger _logger; diff --git a/Frank.PulseFlow/PulseFlowBuilder.cs b/Frank.PulseFlow/FlowBuilder.cs similarity index 65% rename from Frank.PulseFlow/PulseFlowBuilder.cs rename to Frank.PulseFlow/FlowBuilder.cs index 50fadc7..0980fcc 100644 --- a/Frank.PulseFlow/PulseFlowBuilder.cs +++ b/Frank.PulseFlow/FlowBuilder.cs @@ -2,11 +2,11 @@ namespace Frank.PulseFlow; -public class PulseFlowBuilder : IPulseFlowBuilder +public class FlowBuilder : IFlowBuilder { private readonly IServiceCollection _services; - public PulseFlowBuilder(IServiceCollection services) + public FlowBuilder(IServiceCollection services) { _services = services; } @@ -16,9 +16,9 @@ public PulseFlowBuilder(IServiceCollection services) /// /// The type of the flow to be added. /// The pulse flow builder instance. - public IPulseFlowBuilder AddFlow() where T : class, IPulseFlow + public IFlowBuilder AddFlow() where T : class, IFlow { - _services.AddTransient(); + _services.AddTransient(); return this; } } \ No newline at end of file diff --git a/Frank.PulseFlow/IPulseFlow.cs b/Frank.PulseFlow/IFlow.cs similarity index 90% rename from Frank.PulseFlow/IPulseFlow.cs rename to Frank.PulseFlow/IFlow.cs index ee90eb0..a95c268 100644 --- a/Frank.PulseFlow/IPulseFlow.cs +++ b/Frank.PulseFlow/IFlow.cs @@ -1,9 +1,9 @@ namespace Frank.PulseFlow; /// -/// Represents a component that handles pulse flows. +/// A flow is something that handles a pulse /// -public interface IPulseFlow +public interface IFlow { /// /// Handles the pulse asynchronously. diff --git a/Frank.PulseFlow/IFlowBuilder.cs b/Frank.PulseFlow/IFlowBuilder.cs new file mode 100644 index 0000000..53cb316 --- /dev/null +++ b/Frank.PulseFlow/IFlowBuilder.cs @@ -0,0 +1,11 @@ +namespace Frank.PulseFlow; + +public interface IFlowBuilder +{ + /// + /// Adds a flow of type T to the flow builder. + /// + /// The type of flow to add. + /// The flow builder instance with the added flow. + IFlowBuilder AddFlow() where T : class, IFlow; +} \ No newline at end of file diff --git a/Frank.PulseFlow/IPulseFlowBuilder.cs b/Frank.PulseFlow/IPulseFlowBuilder.cs deleted file mode 100644 index 451ff07..0000000 --- a/Frank.PulseFlow/IPulseFlowBuilder.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Frank.PulseFlow; - -public interface IPulseFlowBuilder -{ - /// - /// Adds a flow of type T to the pulse flow builder. - /// - /// The type of flow to add. - /// The pulse flow builder instance with the added flow. - IPulseFlowBuilder AddFlow() where T : class, IPulseFlow; -} \ No newline at end of file diff --git a/Frank.PulseFlow/Internal/PulseNexus.cs b/Frank.PulseFlow/Internal/PulseNexus.cs index c863048..8585761 100644 --- a/Frank.PulseFlow/Internal/PulseNexus.cs +++ b/Frank.PulseFlow/Internal/PulseNexus.cs @@ -5,9 +5,9 @@ namespace Frank.PulseFlow.Internal; internal class PulseNexus : BackgroundService { private readonly IChannel _channel; - private readonly IEnumerable _pulseFlows; + private readonly IEnumerable _pulseFlows; - public PulseNexus(IChannel channel, IEnumerable pulseFlows) + public PulseNexus(IChannel channel, IEnumerable pulseFlows) { _channel = channel; _pulseFlows = pulseFlows; diff --git a/Frank.PulseFlow/ServiceCollectionExtensions.cs b/Frank.PulseFlow/ServiceCollectionExtensions.cs index f704699..bcc6e66 100644 --- a/Frank.PulseFlow/ServiceCollectionExtensions.cs +++ b/Frank.PulseFlow/ServiceCollectionExtensions.cs @@ -12,9 +12,9 @@ public static class ServiceCollectionExtensions /// The service collection to which the PulseFlow components will be added. /// An action delegate to configure the PulseFlow builder. /// The updated service collection. - public static IServiceCollection AddPulseFlow(this IServiceCollection services, Action configure) + public static IServiceCollection AddPulseFlow(this IServiceCollection services, Action configure) { - PulseFlowBuilder builder = new(services); + FlowBuilder builder = new(services); configure(builder); services.AddHostedService();