コード例 #1
0
 private void InactivateProcedureStart() =>
 startProcess(INACTIVATE_PROCEDURE, ProcessType.InactivateProcedure, () =>
 {
     if (ActiveProcedures.Any())
     {
         IProcedure randomProcedure = ActiveProcedures.GetRandomProcedure();
         if (randomProcedure != null)
         {
             InactivateProcedure(randomProcedure);
         }
     }
 });
コード例 #2
0
        private void ExecuteRequestStart() =>
        startProcess(REQUEST, ProcessType.ExecuteRequest, () =>
        {
            if (ActiveProcedures.Any())
            {
                IProcedure procedure = ActiveProcedures.GetRandomProcedure();
                if (procedure != null)
                {
                    _log.processoFezUmaRequisicao(procedure.Identifier);
                    bool recieved = procedure.SendRequest();

                    if (!recieved)
                    {
                        _log.naoFoiObtidaNenhumaRespostaParaARequisicao();
                        procedure.BeginElection();
                    }
                }
            }
        });