Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed IPulseFlow.cs to IFlow and all related names #9 #10

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Frank.PulseFlow.Tests.Cli/TextPulseFlow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Frank.PulseFlow.Tests.Cli;

public class TextPulseFlow : IPulseFlow
public class TextPulseFlow : IFlow
{
private readonly ILogger<TextPulseFlow> _logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -16,9 +16,9 @@ public PulseFlowBuilder(IServiceCollection services)
/// </summary>
/// <typeparam name="T">The type of the flow to be added.</typeparam>
/// <returns>The pulse flow builder instance.</returns>
public IPulseFlowBuilder AddFlow<T>() where T : class, IPulseFlow
public IFlowBuilder AddFlow<T>() where T : class, IFlow
{
_services.AddTransient<IPulseFlow, T>();
_services.AddTransient<IFlow, T>();
return this;
}
}
4 changes: 2 additions & 2 deletions Frank.PulseFlow/IPulseFlow.cs → Frank.PulseFlow/IFlow.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Frank.PulseFlow;

/// <summary>
/// Represents a component that handles pulse flows.
/// A flow is something that handles a pulse
/// </summary>
public interface IPulseFlow
public interface IFlow
{
/// <summary>
/// Handles the pulse asynchronously.
Expand Down
11 changes: 11 additions & 0 deletions Frank.PulseFlow/IFlowBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Frank.PulseFlow;

public interface IFlowBuilder
{
/// <summary>
/// Adds a flow of type T to the flow builder.
/// </summary>
/// <typeparam name="T">The type of flow to add.</typeparam>
/// <returns>The flow builder instance with the added flow.</returns>
IFlowBuilder AddFlow<T>() where T : class, IFlow;
}
11 changes: 0 additions & 11 deletions Frank.PulseFlow/IPulseFlowBuilder.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Frank.PulseFlow/Internal/PulseNexus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Frank.PulseFlow.Internal;
internal class PulseNexus : BackgroundService
{
private readonly IChannel _channel;
private readonly IEnumerable<IPulseFlow> _pulseFlows;
private readonly IEnumerable<IFlow> _pulseFlows;

public PulseNexus(IChannel channel, IEnumerable<IPulseFlow> pulseFlows)
public PulseNexus(IChannel channel, IEnumerable<IFlow> pulseFlows)
{
_channel = channel;
_pulseFlows = pulseFlows;
Expand Down
4 changes: 2 additions & 2 deletions Frank.PulseFlow/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public static class ServiceCollectionExtensions
/// <param name="services">The service collection to which the PulseFlow components will be added.</param>
/// <param name="configure">An action delegate to configure the PulseFlow builder.</param>
/// <returns>The updated service collection.</returns>
public static IServiceCollection AddPulseFlow(this IServiceCollection services, Action<IPulseFlowBuilder> configure)
public static IServiceCollection AddPulseFlow(this IServiceCollection services, Action<IFlowBuilder> configure)
{
PulseFlowBuilder builder = new(services);
FlowBuilder builder = new(services);
configure(builder);

services.AddHostedService<PulseNexus>();
Expand Down
Loading