Example #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);
        }
Example #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);
        }