mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-07-27 03:36:52 +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);
|
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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user