Example #1
0
        public static void WaitForInitializableState(IStatefulExecution state, bool allowFailed)
        {
            MethodContract.NotNull(state, nameof(state));

            System.Threading.SpinWait waiter = new System.Threading.SpinWait();
            while (true)
            {
                if (Initializable(state.State, allowFailed))
                {
                    return;
                }
                if (allowFailed && Failed(state.State))
                {
                    return; //try to allow a recovery here
                }
                waiter.SpinOnce();
            }
        }
Example #2
0
 public static void WaitForInitializableState(IStatefulExecution state)
 {
     WaitForInitializableState(state, false);
 }
Example #3
0
 public static void WaitForBootstrappableState(IStatefulExecution state)
 {
     WaitForBootstrappableState(state, false);
 }