1
0
mirror of synced 2024-11-22 17:23:49 +00:00
Tapeti/Tapeti.Flow/Default/DelegateYieldPoint.cs

26 lines
552 B
C#
Raw Normal View History

using System;
using System.Threading.Tasks;
namespace Tapeti.Flow.Default
{
internal class DelegateYieldPoint : IExecutableYieldPoint
{
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);
}
}
}