Beispiel #1
0
        public async Task <bool> Notify(Dictionary <DeltaOpType, List <long> > modelChanges)
        {
            logger.LogDebug($"{baseLogString } Notify method.");

            //while (!ReliableDictionariesInitialized)
            //{
            //    await Task.Delay(1000);
            //}

            //var tasks = new List<Task>();

            //foreach (var element in modelChanges)
            //{
            //    tasks.Add(ModelChanges.SetAsync((byte)element.Key, element.Value));
            //}

            //Task.WaitAll(tasks.ToArray());


            ITransactionEnlistmentContract transactionEnlistmentClient = TransactionEnlistmentClient.CreateClient();

            logger.LogDebug($"{baseLogString } Notify calling enlist.");
            bool success = await transactionEnlistmentClient.Enlist(DistributedTransactionNames.NetworkModelUpdateTransaction, MicroserviceNames.CeModelProviderService);

            if (success)
            {
                Logger.LogInformation($"{baseLogString} Notify => CE SUCCESSFULLY notified about network model update.");
            }
            else
            {
                Logger.LogInformation($"{baseLogString} Notify => CE UNSUCCESSFULLY notified about network model update.");
            }

            return(success);
        }
Beispiel #2
0
        public async Task <bool> Notify(Dictionary <DeltaOpType, List <long> > modelChanges)
        {
            logger.LogDebug($"{baseLogString } Notify method.");

            ITransactionEnlistmentContract transactionEnlistmentClient = TransactionEnlistmentClient.CreateClient();

            logger.LogDebug($"{baseLogString } Notify calling enlist.");
            bool success = await transactionEnlistmentClient.Enlist(DistributedTransactionNames.NetworkModelUpdateTransaction, MicroserviceNames.CeModelProviderService);

            if (success)
            {
                Logger.LogInformation($"{baseLogString} Notify => CE SUCCESSFULLY notified about network model update.");
            }
            else
            {
                Logger.LogInformation($"{baseLogString} Notify => CE UNSUCCESSFULLY notified about network model update.");
            }

            return(success);
        }
        public async Task <bool> Notify(Dictionary <DeltaOpType, List <long> > modelChanges)
        {
            while (!ReliableDictionariesInitialized)
            {
                await Task.Delay(1000);
            }

            StashChanges(modelChanges);

            var  transactionEnlistmentClient = TransactionEnlistmentClient.CreateClient();
            bool success = await transactionEnlistmentClient.Enlist(DistributedTransactionNames.NetworkModelUpdateTransaction, MicroserviceNames.OmsHistoryDBManagerService);

            if (success)
            {
                Logger.LogInformation($"{baseLogString} Notify => {MicroserviceNames.OmsHistoryDBManagerService} SUCCESSFULLY notified about network model update.");
            }
            else
            {
                Logger.LogInformation($"{baseLogString} Notify => {MicroserviceNames.OmsHistoryDBManagerService} UNSUCCESSFULLY notified about network model update.");
            }

            return(success);
        }