1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-18 03:43:00 +00:00

Added interfaces to base class so they implement IDisposable

This commit is contained in:
Jan Korf
2019-04-09 10:08:14 +02:00
parent 96d553d093
commit 53254e8d0f
4 changed files with 110 additions and 2 deletions
@@ -0,0 +1,45 @@
using System;
using System.Threading.Tasks;
using CryptoExchange.Net.Sockets;
namespace CryptoExchange.Net.Interfaces
{
/// <summary>
/// Base class for socket API implementations
/// </summary>
public interface ISocketClient: IDisposable
{
/// <summary>
/// The factory for creating sockets. Used for unit testing
/// </summary>
IWebsocketFactory SocketFactory { get; set; }
/// <summary>
/// The time in between reconnect attempts
/// </summary>
TimeSpan ReconnectInterval { get; }
/// <summary>
/// Whether the client should try to auto reconnect when losing connection
/// </summary>
bool AutoReconnect { get; }
/// <summary>
/// The base address of the API
/// </summary>
string BaseAddress { get; }
/// <summary>
/// Unsubscribe from a stream
/// </summary>
/// <param name="subscription">The subscription to unsubscribe</param>
/// <returns></returns>
Task Unsubscribe(UpdateSubscription subscription);
/// <summary>
/// Unsubscribe all subscriptions
/// </summary>
/// <returns></returns>
Task UnsubscribeAll();
}
}