1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-08 00:16:27 +00:00

changed some events actions to named tuples for ability more clearly understanding what does exactly happened. fixes typo at OnOrderBookUpdate event invocation

This commit is contained in:
Артем Курьянов 2020-08-11 15:52:26 +00:00
parent 3cd54847c7
commit 4b1baf8b82
2 changed files with 9 additions and 9 deletions

View File

@ -31,11 +31,11 @@ namespace CryptoExchange.Net.Interfaces
/// <summary>
/// Event when order book was updated. Be careful! It can generate a lot of events at high-liquidity markets
/// </summary>
event Action<IEnumerable<ISymbolOrderBookEntry>, IEnumerable<ISymbolOrderBookEntry>> OnOrderBookUpdate;
event Action<(IEnumerable<ISymbolOrderBookEntry> Bids, IEnumerable<ISymbolOrderBookEntry> Asks)> OnOrderBookUpdate;
/// <summary>
/// Event when the BestBid or BestAsk changes ie a Pricing Tick
/// </summary>
event Action<ISymbolOrderBookEntry, ISymbolOrderBookEntry> OnBestOffersChanged;
event Action<(ISymbolOrderBookEntry BestBid, ISymbolOrderBookEntry BestAsk)> OnBestOffersChanged;
/// <summary>
/// Timestamp of the last update
/// </summary>

View File

@ -96,12 +96,12 @@ namespace CryptoExchange.Net.OrderBook
/// <summary>
/// Event when the BestBid or BestAsk changes ie a Pricing Tick
/// </summary>
public event Action<ISymbolOrderBookEntry, ISymbolOrderBookEntry>? OnBestOffersChanged;
public event Action<(ISymbolOrderBookEntry BestBid, ISymbolOrderBookEntry BestAsk)>? OnBestOffersChanged;
/// <summary>
/// Event when order book was updated, containing the changed bids and asks. Be careful! It can generate a lot of events at high-liquidity markets
/// Event when order book was updated, containing the changed bids and asks. Be careful! It can generate a lot of events at high-liquidity markets
/// </summary>
public event Action<IEnumerable<ISymbolOrderBookEntry>, IEnumerable<ISymbolOrderBookEntry>>? OnOrderBookUpdate;
public event Action<(IEnumerable<ISymbolOrderBookEntry> Bids, IEnumerable<ISymbolOrderBookEntry> Asks)>? OnOrderBookUpdate;
/// <summary>
/// Timestamp of the last update
/// </summary>
@ -356,8 +356,8 @@ namespace CryptoExchange.Net.OrderBook
LastOrderBookUpdate = DateTime.UtcNow;
log.Write(LogVerbosity.Debug, $"{Id} order book {Symbol} data set: {BidCount} bids, {AskCount} asks. #{item.EndUpdateId}");
CheckProcessBuffer();
OnOrderBookUpdate?.Invoke(item.Asks, item.Bids);
OnBestOffersChanged?.Invoke(BestBid, BestAsk);
OnOrderBookUpdate?.Invoke((item.Bids, item.Asks));
OnBestOffersChanged?.Invoke((BestBid, BestAsk));
}
}
@ -392,7 +392,7 @@ namespace CryptoExchange.Net.OrderBook
return;
}
OnOrderBookUpdate?.Invoke(item.Bids, item.Asks);
OnOrderBookUpdate?.Invoke((item.Bids, item.Asks));
CheckBestOffersChanged(prevBestBid, prevBestAsk);
}
}
@ -601,7 +601,7 @@ namespace CryptoExchange.Net.OrderBook
var (bestBid, bestAsk) = BestOffers;
if (bestBid.Price != prevBestBid.Price || bestBid.Quantity != prevBestBid.Quantity ||
bestAsk.Price != prevBestAsk.Price || bestAsk.Quantity != prevBestAsk.Quantity)
OnBestOffersChanged?.Invoke(bestBid, bestAsk);
OnBestOffersChanged?.Invoke((bestBid, bestAsk));
}
/// <summary>