Exemple #1
0
 private async Task NotiftBestPrice(AssetPairBestRate assetPairBestRate)
 {
     foreach (var assetPairBestPriceNotifier in _assetPairBestPriceNotifiers)
     {
         await assetPairBestPriceNotifier.NotifyNewAsset(assetPairBestRate);
     }
 }
Exemple #2
0
        public static void BroadcastPrice(AssetPairBestRate price)
        {
            var asset = Dependencies.AssetPairsDictionary.Get(price.Id);

            if (asset == null)
            {
                return;
            }

            var hub = GlobalHost.ConnectionManager.GetLkHub();

            var bid = price.Bid;
            var ask = price.Ask;

            hub.Clients.All.Price(new { id = price.Id, bid, ask });
        }
Exemple #3
0
        public Task NotifyNewAsset(AssetPairBestRate assetQuote)
        {
            _readerWriterLockSlim.EnterWriteLock();
            try
            {
                if (!_profile.ContainsKey(assetQuote.Id))
                {
                    _profile.Add(assetQuote.Id, assetQuote);
                }
                else
                {
                    _profile[assetQuote.Id] = assetQuote;
                }
            }
            finally
            {
                _readerWriterLockSlim.ExitWriteLock();
            }

            return(Task.FromResult(0));
        }
Exemple #4
0
 public Task NotifyNewAsset(AssetPairBestRate assetQuote)
 {
     Changes.Add(assetQuote);
     return(Task.FromResult(0));
 }
Exemple #5
0
 public Task NotifyNewAsset(AssetPairBestRate assetQuote)
 {
     _notificationAction(assetQuote);
     return(Task.FromResult(0));
 }