Esempio n. 1
0
        public override Task Execute()
        {
            var accounts = GetAccountsToWriteStats();
            var accountsStatsMessages = GenerateAccountsStatsUpdateMessages(accounts);
            var tasks = accountsStatsMessages.Select(m => _rabbitMqNotifyService.UpdateAccountStats(m));

            return(Task.WhenAll(tasks));
        }
Esempio n. 2
0
        private void NotifyAccountStatsChanged(IMarginTradingAccount account)
        {
            var stats = account.ToRabbitMqContract(_marginSettings.IsLive);

            _rabbitMqNotifyService.UpdateAccountStats(new AccountStatsUpdateMessage {
                Accounts = new[] { stats }
            });
        }