Skip to content

Commit

Permalink
Dropped cancellation token on handlers as it is not currently being used
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-foster-cko committed Mar 17, 2018
1 parent ae0c8ec commit e41b3e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Flo/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public TBuilder Add(Func<IHandler<TIn, TOut>> handlerFactory)

if (handler != null)
{
return handler.HandleAsync(input, next, CancellationToken.None);
return handler.HandleAsync(input, next);
}

return next.Invoke(input);
Expand Down
2 changes: 1 addition & 1 deletion src/Flo/IHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Flo
{
public interface IHandler<TIn, TOut>
{
Task<TOut> HandleAsync(TIn input, Func<TIn, Task<TOut>> next, CancellationToken token);
Task<TOut> HandleAsync(TIn input, Func<TIn, Task<TOut>> next);
}

public interface IHandler<T> : IHandler<T, T>
Expand Down
8 changes: 4 additions & 4 deletions test/Flo.Tests/HandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async Task it_can_use_a_custom_service_provider()

class TestHandler : IHandler<TestContext>
{
public Task<TestContext> HandleAsync(TestContext input, Func<TestContext, Task<TestContext>> next, CancellationToken cancellationToken)
public Task<TestContext> HandleAsync(TestContext input, Func<TestContext, Task<TestContext>> next)
{
input.Add(Guid.NewGuid().ToString(), Guid.NewGuid());
return next.Invoke(input);
Expand All @@ -72,7 +72,7 @@ public LazyHandler(Action callback)
_callback = callback;
}

public Task<object> HandleAsync(object input, Func<object, Task<object>> next, CancellationToken cancellationToken)
public Task<object> HandleAsync(object input, Func<object, Task<object>> next)
{
_callback.Invoke();
return next.Invoke(input);
Expand All @@ -81,7 +81,7 @@ public Task<object> HandleAsync(object input, Func<object, Task<object>> next, C

class StringLengthCountHandler : IHandler<string, int>
{
public Task<int> HandleAsync(string input, Func<string, Task<int>> next, CancellationToken cancellationToken)
public Task<int> HandleAsync(string input, Func<string, Task<int>> next)
{
return Task.FromResult(input.Length);
}
Expand All @@ -98,7 +98,7 @@ public OverridingHandler(string output)
_output = output;
}

public Task<string> HandleAsync(string input, Func<string, Task<string>> next, CancellationToken cancellationToken)
public Task<string> HandleAsync(string input, Func<string, Task<string>> next)
{
return Task.FromResult("Override");
}
Expand Down

0 comments on commit e41b3e4

Please sign in to comment.