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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-08-15 12:04:03 +02:00
|
|
|
|
public async Task Execute(FlowContext context)
|
2017-01-31 12:01:08 +01:00
|
|
|
|
{
|
2024-04-08 14:20:15 +02:00
|
|
|
|
await onExecute(context).ConfigureAwait(false);
|
2017-01-31 12:01:08 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|