2017-01-31 11:01:08 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow.Default
|
|
|
|
|
{
|
2017-10-17 08:34:07 +00:00
|
|
|
|
internal class DelegateYieldPoint : IYieldPoint
|
2017-01-31 11:01:08 +00:00
|
|
|
|
{
|
|
|
|
|
private readonly Func<FlowContext, Task> onExecute;
|
|
|
|
|
|
|
|
|
|
|
2017-10-17 08:34:07 +00:00
|
|
|
|
public DelegateYieldPoint(Func<FlowContext, Task> onExecute)
|
2017-01-31 11:01:08 +00:00
|
|
|
|
{
|
|
|
|
|
this.onExecute = onExecute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-08-15 10:04:03 +00:00
|
|
|
|
public async Task Execute(FlowContext context)
|
2017-01-31 11:01:08 +00:00
|
|
|
|
{
|
2024-04-08 12:20:15 +00:00
|
|
|
|
await onExecute(context).ConfigureAwait(false);
|
2017-01-31 11:01:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|