Esempio n. 1
0
 public override IStateMachineEnumerator <TContext, TStateId, TStatefulTaskWithRollback> GetStateMachineEnumerator()
 {
     return(new StateMachineWithRollbackEnumerator <TContext, TStateId, TStatefulTaskWithRollback>(
                realEnumerator: _realProvider.GetStateMachineEnumerator(),
                continueRollbackOnFailed: _continueRollbackOnFailed
                ));
 }
Esempio n. 2
0
 public override IStateMachineEnumerator <TContext, TStateId, TStatefulTask> GetStateMachineEnumerator()
 {
     return(new StateMachineSafeEnumerator <TContext, TStateId, TStatefulTask>(
                realEnumerator: _realProvider.GetStateMachineEnumerator(),
                continueExecutionOnFailed: _continueExecutionOnFailed,
                handler: _handler
                ));
 }
Esempio n. 3
0
        public static TContext Execute <TContext, TStateId, TStatefulTask>(
            this IStateMachineProvider <TContext, TStateId, TStatefulTask> provider)
            where TStatefulTask : class, IStatefulTask <TContext, TStateId>
        {
            provider.ThrowIfNull(nameof(provider));

            using var enumerator = provider.GetStateMachineEnumerator();
            while (enumerator.MoveNext())
            {
                // All actions perform in MoveNext.
            }

            return(enumerator.Context);
        }