mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-21 05:13:21 +00:00
Added GetSubscriptionByRequest method on socket connection
This commit is contained in:
@@ -235,6 +235,17 @@ namespace CryptoExchange.Net.Sockets
|
|||||||
return subscriptions.SingleOrDefault(s => s.Id == id);
|
return subscriptions.SingleOrDefault(s => s.Id == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a subscription on this connection by its subscribe request
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="predicate">Filter for a request</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public SocketSubscription? GetSubscriptionByRequest(Func<object?, bool> predicate)
|
||||||
|
{
|
||||||
|
lock(subscriptionLock)
|
||||||
|
return subscriptions.SingleOrDefault(s => predicate(s.Request));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process data
|
/// Process data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user