2017-01-31 11:01:08 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow.Default
|
|
|
|
|
{
|
2017-02-12 18:04:26 +00:00
|
|
|
|
internal class DelegateYieldPoint : IStateYieldPoint, IExecutableYieldPoint
|
2017-01-31 11:01:08 +00:00
|
|
|
|
{
|
|
|
|
|
public bool StoreState { get; }
|
|
|
|
|
|
|
|
|
|
private readonly Func<FlowContext, Task> onExecute;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DelegateYieldPoint(bool storeState, Func<FlowContext, Task> onExecute)
|
|
|
|
|
{
|
|
|
|
|
StoreState = storeState;
|
|
|
|
|
this.onExecute = onExecute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Task Execute(FlowContext context)
|
|
|
|
|
{
|
|
|
|
|
return onExecute(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|