mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 08:26:20 +00:00
Added GetSubscriptionByRequest method on socket connection
This commit is contained in:
parent
7aad9482a5
commit
baa23c2ecc
@ -235,6 +235,17 @@ namespace CryptoExchange.Net.Sockets
|
||||
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>
|
||||
/// Process data
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user