API documentation
ConnectedUser
public class ConnectedUser : Actor<string>, IAsyncDisposable
{
public ConnectedUser(
string userId,
DbOptions dbOptions,
IClientProxy clientProxy,
IFrameworkService framework, // singleton
StreamClientOptions options,
TimeSpan idleTimeout,
bool isSCAEnabled,
OneSignalService oneSignalService)
: base(userId, isPaused: isSCAEnabled)
{
EnsureArg.IsNotNullOrWhiteSpace(userId, nameof(userId));
EnsureArg.IsNotNull(dbOptions, nameof(dbOptions));
EnsureArg.IsNotNull(clientProxy, nameof(clientProxy));
EnsureArg.IsNotNull(framework, nameof(framework));
EnsureArg.IsNotNull(options, nameof(options));
EnsureArg.IsNotNull(oneSignalService, nameof(oneSignalService));
this.UserId = userId;
this.dbOptions = dbOptions;
this.clientProxy = clientProxy;
this.framework = framework;
this.options = options;
this.idleTimeout = idleTimeout;
this.oneSignalService = oneSignalService;
this.idleTimer = new Timer(
_ => OnIdleTimer(this, EventArgs.Empty),
null,
Timeout.InfiniteTimeSpan,
Timeout.InfiniteTimeSpan);
this.ConnectionIds = new HashSet<string>();
this.StreamStatus = StreamConnectionStatus.Disconnected;
this.streamClient = new ObermindStreamClient();
this.SubscribeToStreamClientEvents();
this.streamClientCreatedAt = DateTime.UtcNow;
this.orderCounter = OrderIdStartValue;
this.banCheckTimer = new Timer(
this.KickBannedUser,
null,
TimeSpan.Zero,
TimeSpan.FromSeconds(60));
this.instrumentLastPrices = new Dictionary<int, LastPriceInfo>();
}