2017-01-31 12:01:08 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow.Default
|
|
|
|
|
{
|
2017-10-17 10:34:07 +02:00
|
|
|
|
internal class DelegateYieldPoint : IYieldPoint
|
2017-01-31 12:01:08 +01:00
|
|
|
|
{
|
|
|
|
|
private readonly Func<FlowContext, Task> onExecute;
|
|
|
|
|
|
|
|
|
|
|
2017-10-17 10:34:07 +02:00
|
|
|
|
public DelegateYieldPoint(Func<FlowContext, Task> onExecute)
|
2017-01-31 12:01:08 +01:00
|
|
|
|
{
|
|
|
|
|
this.onExecute = onExecute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Task Execute(FlowContext context)
|
|
|
|
|
{
|
|
|
|
|
return onExecute(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|