public Connection(IMessageBus newMessageBus, IJsonSerializer jsonSerializer, string baseSignal, string connectionId, IList<string> signals, IList<string> groups, ITraceManager traceManager, IAckHandler ackHandler, IPerformanceCounterManager performanceCounterManager, IProtectedData protectedData) { if (traceManager == null) { throw new ArgumentNullException("traceManager"); } _bus = newMessageBus; _serializer = jsonSerializer; _baseSignal = baseSignal; _connectionId = connectionId; _signals = new List<string>(signals.Concat(groups)); _groups = new DiffSet<string>(groups); _traceSource = traceManager["SignalR.Connection"]; _ackHandler = ackHandler; _counters = performanceCounterManager; _protectedData = protectedData; }
public Connection(IMessageBus newMessageBus, JsonSerializer jsonSerializer, string baseSignal, string connectionId, IList<string> signals, IList<string> groups, ILoggerFactory loggerFactory, IAckHandler ackHandler, IPerformanceCounterManager performanceCounterManager, IProtectedData protectedData, IMemoryPool pool) { if (loggerFactory == null) { throw new ArgumentNullException("loggerFactory"); } _bus = newMessageBus; _serializer = jsonSerializer; _baseSignal = baseSignal; _connectionId = connectionId; _signals = new List<string>(signals.Concat(groups)); _groups = new DiffSet<string>(groups); _logger = loggerFactory.CreateLogger<Connection>(); _ackHandler = ackHandler; _counters = performanceCounterManager; _protectedData = protectedData; _excludeMessage = m => ExcludeMessage(m); _pool = pool; }
public MessageRouter(ISocketFactory socketFactory, IInternalRoutingTable internalRoutingTable, IExternalRoutingTable externalRoutingTable, IScaleOutConfigurationProvider scaleOutConfigurationProvider, IClusterServices clusterServices, IServiceMessageHandlerRegistry serviceMessageHandlerRegistry, IPerformanceCounterManager <KinoPerformanceCounters> performanceCounterManager, ISecurityProvider securityProvider, ILocalSocket <IMessage> localRouterSocket, ILocalReceivingSocket <InternalRouteRegistration> internalRegistrationsReceiver, IInternalMessageRouteRegistrationHandler internalRegistrationHandler, IRoundRobinDestinationList roundRobinDestinationList, ILogger logger) { this.logger = logger; this.socketFactory = socketFactory; this.internalRoutingTable = internalRoutingTable; this.externalRoutingTable = externalRoutingTable; this.scaleOutConfigurationProvider = scaleOutConfigurationProvider; this.clusterServices = clusterServices; this.serviceMessageHandlerRegistry = serviceMessageHandlerRegistry; this.performanceCounterManager = performanceCounterManager; this.securityProvider = securityProvider; this.localRouterSocket = localRouterSocket; this.localRouterSocket.SendRate = performanceCounterManager.GetCounter(KinoPerformanceCounters.MessageRouterLocalSocketSendRate); this.localRouterSocket.ReceiveRate = performanceCounterManager.GetCounter(KinoPerformanceCounters.MessageRouterLocalSocketReceiveRate); this.internalRegistrationsReceiver = internalRegistrationsReceiver; this.internalRegistrationHandler = internalRegistrationHandler; this.roundRobinDestinationList = roundRobinDestinationList; }
public TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartBeat heartBeat, IPerformanceCounterManager performanceCounterManager) { _context = context; _jsonSerializer = jsonSerializer; _heartBeat = heartBeat; _counters = performanceCounterManager; }
public MessageBroker(ConcurrentDictionary <string, Topic> topics, IPerformanceCounterManager performanceCounterManager) { _topics = topics; _counters = performanceCounterManager; _timer = new Timer(_ => OnTimer(), state: null, dueTime: CheckWorkInterval, period: CheckWorkInterval); }
public ScaleoutSubscription(string identity, IList <string> eventKeys, string cursor, IList <ScaleoutMappingStore> stores, Func <MessageResult, object, Task <bool> > callback, int maxMessages, IPerformanceCounterManager counters, object state) : base(identity, eventKeys, callback, maxMessages, counters, state) { if (stores == null) { throw new ArgumentNullException("stores"); } _stores = stores; List <Cursor> cursors = null; if (String.IsNullOrEmpty(cursor)) { cursors = new List <Cursor>(stores.Count); for (int i = 0; i < stores.Count; i++) { cursors.Add(new Cursor(i.ToString(CultureInfo.InvariantCulture), stores[i].MaxKey)); } } else { cursors = Cursor.GetCursors(cursor); } _cursors = cursors; }
public ScaleoutStreamManager(Func<int, IList<Message>, Task> send, Action<int, ulong, ScaleoutMessage> receive, int streamCount, TraceSource trace, IPerformanceCounterManager performanceCounters, ScaleoutConfiguration configuration) { if (configuration.QueueBehavior != QueuingBehavior.Disabled && configuration.MaxQueueLength == 0) { throw new InvalidOperationException(Resources.Error_ScaleoutQueuingConfig); } _streams = new ScaleoutStream[streamCount]; _send = send; _receive = receive; var receiveMapping = new ScaleoutMappingStore[streamCount]; performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount; performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount; performanceCounters.ScaleoutStreamCountOpen.RawValue = 0; for (int i = 0; i < streamCount; i++) { _streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.QueueBehavior, configuration.MaxQueueLength, performanceCounters); receiveMapping[i] = new ScaleoutMappingStore(); } Streams = new ReadOnlyCollection<ScaleoutMappingStore>(receiveMapping); }
protected TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager) { if (context == null) { throw new ArgumentNullException("context"); } if (jsonSerializer == null) { throw new ArgumentNullException("jsonSerializer"); } if (heartbeat == null) { throw new ArgumentNullException("heartbeat"); } if (performanceCounterManager == null) { throw new ArgumentNullException("performanceCounterManager"); } if (traceManager == null) { throw new ArgumentNullException("traceManager"); } _context = context; _jsonSerializer = jsonSerializer; _heartbeat = heartbeat; _counters = performanceCounterManager; _trace = traceManager["SignalR.Transports." + GetType().Name]; }
public ScaleoutStreamManager(Func<int, IList<Message>, Task> send, Action<int, ulong, ScaleoutMessage> receive, int streamCount, TraceSource trace, IPerformanceCounterManager performanceCounters, ScaleoutConfiguration configuration) { _streams = new ScaleoutStream[streamCount]; _send = send; _receive = receive; var receiveMapping = new ScaleoutMappingStore[streamCount]; performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount; performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount; performanceCounters.ScaleoutStreamCountOpen.RawValue = 0; for (int i = 0; i < streamCount; i++) { _streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.MaxQueueLength, performanceCounters); receiveMapping[i] = new ScaleoutMappingStore(); } Streams = new ReadOnlyCollection<ScaleoutMappingStore>(receiveMapping); }
public Connection(IMessageBus newMessageBus, IJsonSerializer jsonSerializer, string baseSignal, string connectionId, IList <string> signals, IList <string> groups, ITraceManager traceManager, IAckHandler ackHandler, IPerformanceCounterManager performanceCounterManager, IProtectedData protectedData) { if (traceManager == null) { throw new ArgumentNullException("traceManager"); } _bus = newMessageBus; _serializer = jsonSerializer; _baseSignal = baseSignal; _connectionId = connectionId; _signals = new List <string>(signals.Concat(groups)); _groups = new DiffSet <string>(groups); _traceSource = traceManager["SignalR.Connection"]; _ackHandler = ackHandler; _counters = performanceCounterManager; _protectedData = protectedData; }
public ServiceBusMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor, IOptions <ServiceBusScaleoutOptions> scaleoutConfigurationAccessor) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor) { var configuration = scaleoutConfigurationAccessor.Value; if (configuration == null) { throw new ArgumentNullException("configuration"); } if (String.IsNullOrEmpty(configuration.TopicPrefix)) { throw new InvalidOperationException("TopixPrefix is invalid"); } _logger = loggerFactory.CreateLogger <ServiceBusMessageBus>(); _connection = new ServiceBusConnection(configuration, _logger); _topics = Enumerable.Range(0, configuration.TopicCount) .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex) .ToArray(); _connectionContext = new ServiceBusConnectionContext(configuration, _topics, _logger, OnMessage, OnError, Open); ThreadPool.QueueUserWorkItem(Subscribe); }
public ScaleoutStreamManager(Func <int, IList <Message>, Task> send, Action <int, ulong, ScaleoutMessage> receive, int streamCount, TraceSource trace, IPerformanceCounterManager performanceCounters, ScaleoutConfiguration configuration) { if (configuration.QueueBehavior != QueuingBehavior.Disabled && configuration.MaxQueueLength == 0) { throw new InvalidOperationException(Resources.Error_ScaleoutQueuingConfig); } _streams = new ScaleoutStream[streamCount]; _send = send; _receive = receive; var receiveMapping = new ScaleoutMappingStore[streamCount]; performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount; performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount; performanceCounters.ScaleoutStreamCountOpen.RawValue = 0; for (int i = 0; i < streamCount; i++) { _streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.QueueBehavior, configuration.MaxQueueLength, performanceCounters); receiveMapping[i] = new ScaleoutMappingStore(); } Streams = new ReadOnlyCollection <ScaleoutMappingStore>(receiveMapping); }
protected TransportDisconnectBase(HostContext context, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager) { if (context == null) { throw new ArgumentNullException("context"); } if (heartbeat == null) { throw new ArgumentNullException("heartbeat"); } if (performanceCounterManager == null) { throw new ArgumentNullException("performanceCounterManager"); } if (traceManager == null) { throw new ArgumentNullException("traceManager"); } _context = context; _heartbeat = heartbeat; _counters = performanceCounterManager; // Queue to protect against overlapping writes to the underlying response stream WriteQueue = new TaskQueue(); _trace = traceManager["SignalR.Transports." + GetType().Name]; }
public ScaleoutSubscription(string identity, IEnumerable<string> eventKeys, string cursor, ConcurrentDictionary<string, Linktionary<ulong, ScaleoutMapping>> streamMappings, Func<MessageResult, Task<bool>> callback, int maxMessages, IPerformanceCounterManager counters) : base(identity, eventKeys, callback, maxMessages, counters) { _streams = streamMappings; IEnumerable<Cursor> cursors = null; if (cursor == null) { cursors = from key in _streams.Keys select new Cursor(key, GetCursorId(key)); } else { cursors = Cursor.GetCursors(cursor); } _cursors = new List<Cursor>(cursors); }
public MessageBroker(ConcurrentDictionary<string, Topic> topics, IPerformanceCounterManager performanceCounterManager) { _topics = topics; _counters = performanceCounterManager; _timer = new Timer(_ => OnTimer(), state: null, dueTime: CheckWorkInterval, period: CheckWorkInterval); }
public ScaleoutSubscription(string identity, IList<string> eventKeys, string cursor, IList<ScaleoutMappingStore> stores, Func<MessageResult, object, Task<bool>> callback, int maxMessages, IPerformanceCounterManager counters, object state) : base(identity, eventKeys, callback, maxMessages, counters, state) { if (stores == null) { throw new ArgumentNullException("stores"); } _stores = stores; List<Cursor> cursors = null; if (String.IsNullOrEmpty(cursor)) { cursors = new List<Cursor>(stores.Count); for (int i = 0; i < stores.Count; i++) { cursors.Add(new Cursor(i.ToString(CultureInfo.InvariantCulture), stores[i].MaxKey)); } } else { cursors = Cursor.GetCursors(cursor); } _cursors = cursors; }
public Connection(IMessageBus newMessageBus, JsonSerializer jsonSerializer, string baseSignal, string connectionId, IList <string> signals, IList <string> groups, ILoggerFactory loggerFactory, IAckHandler ackHandler, IPerformanceCounterManager performanceCounterManager, IProtectedData protectedData, IMemoryPool pool) { if (loggerFactory == null) { throw new ArgumentNullException("loggerFactory"); } _bus = newMessageBus; _serializer = jsonSerializer; _baseSignal = baseSignal; _connectionId = connectionId; _signals = new List <string>(signals.Concat(groups)); _groups = new DiffSet <string>(groups); _logger = loggerFactory.CreateLogger <Connection>(); _ackHandler = ackHandler; _counters = performanceCounterManager; _protectedData = protectedData; _excludeMessage = m => ExcludeMessage(m); _pool = pool; }
public ScaleoutSubscription(string identity, IEnumerable <string> eventKeys, string cursor, ConcurrentDictionary <string, Linktionary <ulong, ScaleoutMapping> > streamMappings, Func <MessageResult, Task <bool> > callback, int maxMessages, IPerformanceCounterManager counters) : base(identity, eventKeys, callback, maxMessages, counters) { _streams = streamMappings; IEnumerable <Cursor> cursors = null; if (cursor == null) { cursors = from key in _streams.Keys select new Cursor { Key = key, Id = GetCursorId(key) }; } else { cursors = Cursor.GetCursors(cursor); } _cursors = new List <Cursor>(cursors); }
internal RedisMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions<MessageBusOptions> optionsAccessor, IOptions<RedisScaleoutOptions> scaleoutConfigurationAccessor, IRedisConnection connection, bool connectAutomatically) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor) { _connectionString = scaleoutConfigurationAccessor.Options.ConnectionString; _db = scaleoutConfigurationAccessor.Options.Database; _key = scaleoutConfigurationAccessor.Options.EventKey; _connection = connection; _logger = loggerFactory.CreateLogger<RedisMessageBus>(); ReconnectDelay = TimeSpan.FromSeconds(2); if (connectAutomatically) { ThreadPool.QueueUserWorkItem(_ => { var ignore = ConnectWithRetry(); }); } }
public TestMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor) { }
internal RedisMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor, IOptions <RedisScaleoutOptions> scaleoutConfigurationAccessor, IRedisConnection connection, bool connectAutomatically) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor) { _connectionString = scaleoutConfigurationAccessor.Options.ConnectionString; _db = scaleoutConfigurationAccessor.Options.Database; _key = scaleoutConfigurationAccessor.Options.EventKey; _connection = connection; _logger = loggerFactory.CreateLogger <RedisMessageBus>(); ReconnectDelay = TimeSpan.FromSeconds(2); if (connectAutomatically) { ThreadPool.QueueUserWorkItem(_ => { var ignore = ConnectWithRetry(); }); } }
public ScaleoutStreamManager(Func <int, IList <Message>, Task> send, Action <int, ulong, ScaleoutMessage> receive, int streamCount, TraceSource trace, IPerformanceCounterManager performanceCounters, ScaleoutConfiguration configuration) { _streams = new ScaleoutStream[streamCount]; _send = send; _receive = receive; var receiveMapping = new ScaleoutMappingStore[streamCount]; performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount; performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount; performanceCounters.ScaleoutStreamCountOpen.RawValue = 0; for (int i = 0; i < streamCount; i++) { _streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.MaxQueueLength, performanceCounters); receiveMapping[i] = new ScaleoutMappingStore(); } Streams = new ReadOnlyCollection <ScaleoutMappingStore>(receiveMapping); }
public RedisMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor, IOptions <RedisScaleoutOptions> scaleoutConfigurationAccessor, IRedisConnection connection) : this(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor, connection, true) { }
public WebSocketTransport(HostContext context, IJsonSerializer serializer, ITransportHeartBeat heartBeat, IPerformanceCounterManager performanceCounterWriter) : base(context, serializer, heartBeat, performanceCounterWriter) { _context = context; }
public RedisMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions<MessageBusOptions> optionsAccessor, IOptions<RedisScaleoutOptions> scaleoutConfigurationAccessor, IRedisConnection connection) : this(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor, connection, true) { }
public TestScaleoutBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptionsAccessor <SignalROptions> optionsAccessor, IOptionsAccessor <ScaleoutConfiguration> scaleoutConfigurationAccessor) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor) { }
/// <summary> /// Creates a new instance of the SqlMessageBus class. /// </summary> /// <param name="resolver">The resolver to use.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> public SqlMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor, IOptions <SqlScaleoutOptions> scaleoutOptionsAccessor) : this(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutOptionsAccessor, SqlClientFactory.Instance.AsIDbProviderFactory()) { }
/// <summary> /// Creates a new instance of the SqlMessageBus class. /// </summary> /// <param name="resolver">The resolver to use.</param> /// <param name="configuration">The SQL scale-out configuration options.</param> public SqlMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions<MessageBusOptions> optionsAccessor, IOptions<SqlScaleoutOptions> scaleoutOptionsAccessor) : this(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutOptionsAccessor, SqlClientFactory.Instance.AsIDbProviderFactory()) { }
protected override IPerformanceCounter[] GetPerformanceCounters(IPerformanceCounterManager counterManager) { if (RunData.Host != "External") { return(base.GetPerformanceCounters(counterManager)); } return(new IPerformanceCounter[0]); }
public ScaleoutSubscription(string identity, IList <string> eventKeys, string cursor, IList <ScaleoutMappingStore> streams, Func <MessageResult, object, Task <bool> > callback, int maxMessages, ITraceManager traceManager, IPerformanceCounterManager counters, object state) : base(identity, eventKeys, callback, maxMessages, counters, state) { if (streams == null) { throw new ArgumentNullException("streams"); } if (traceManager == null) { throw new ArgumentNullException(nameof(traceManager)); } _streams = streams; List <Cursor> cursors = null; if (String.IsNullOrEmpty(cursor)) { cursors = new List <Cursor>(); } else { cursors = Cursor.GetCursors(cursor, _scaleoutCursorPrefix); // If the cursor had a default prefix, "d-", cursors might be null if (cursors == null) { cursors = new List <Cursor>(); } // If the streams don't match the cursors then throw it out else if (cursors.Count != _streams.Count) { cursors.Clear(); } } // No cursors so we need to populate them from the list of streams if (cursors.Count == 0) { for (int streamIndex = 0; streamIndex < _streams.Count; streamIndex++) { AddCursorForStream(streamIndex, cursors); } } _cursors = cursors; _trace = traceManager["SignalR." + typeof(ScaleoutSubscription).Name]; }
protected override IPerformanceCounter[] GetPerformanceCounters(IPerformanceCounterManager counterManager) { if (RunData.Host != "External") { return base.GetPerformanceCounters(counterManager); } return new IPerformanceCounter[0]; }
public ForeverTransport(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartBeat heartBeat, IPerformanceCounterManager performanceCounterWriter) : base(context, jsonSerializer, heartBeat, performanceCounterWriter) { _jsonSerializer = jsonSerializer; _counters = performanceCounterWriter; }
public MessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions<MessageBusOptions> optionsAccessor) { if (stringMinifier == null) { throw new ArgumentNullException("stringMinifier"); } if (loggerFactory == null) { throw new ArgumentNullException("traceManager"); } if (performanceCounterManager == null) { throw new ArgumentNullException("performanceCounterManager"); } if (optionsAccessor == null) { throw new ArgumentNullException("optionsAccessor"); } var options = optionsAccessor.Options; if (options.MessageBufferSize < 0) { throw new ArgumentOutOfRangeException(Resources.Error_BufferSizeOutOfRange); } _stringMinifier = stringMinifier; _loggerFactory = loggerFactory; Counters = performanceCounterManager; _logger = _loggerFactory.CreateLogger<MessageBus>(); _maxTopicsWithNoSubscriptions = options.MaxTopicsWithNoSubscriptions; _gcTimer = new Timer(_ => GarbageCollectTopics(), state: null, dueTime: _gcInterval, period: _gcInterval); _broker = new MessageBroker(Counters) { Logger = _logger }; // The default message store size _messageStoreSize = (uint)options.MessageBufferSize; _topicTtl = options.TopicTTL; _createTopic = CreateTopic; _addEvent = AddEvent; _removeEvent = RemoveEvent; _disposeSubscription = o => DisposeSubscription(o); Topics = new TopicLookup(); }
public MessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor) { if (stringMinifier == null) { throw new ArgumentNullException("stringMinifier"); } if (loggerFactory == null) { throw new ArgumentNullException("traceManager"); } if (performanceCounterManager == null) { throw new ArgumentNullException("performanceCounterManager"); } if (optionsAccessor == null) { throw new ArgumentNullException("optionsAccessor"); } var options = optionsAccessor.Value; if (options.MessageBufferSize < 0) { throw new ArgumentOutOfRangeException(Resources.Error_BufferSizeOutOfRange); } _stringMinifier = stringMinifier; _loggerFactory = loggerFactory; Counters = performanceCounterManager; _logger = _loggerFactory.CreateLogger <MessageBus>(); _maxTopicsWithNoSubscriptions = options.MaxTopicsWithNoSubscriptions; _gcTimer = new Timer(_ => GarbageCollectTopics(), state: null, dueTime: _gcInterval, period: _gcInterval); _broker = new MessageBroker(Counters) { Logger = _logger }; // The default message store size _messageStoreSize = (uint)options.MessageBufferSize; _topicTtl = options.TopicTTL; _createTopic = CreateTopic; _addEvent = AddEvent; _removeEvent = RemoveEvent; _disposeSubscription = o => DisposeSubscription(o); Topics = new TopicLookup(); }
/// <summary> /// /// </summary> /// <param name="traceManager"></param> public MessageBus(ITraceManager traceManager, IPerformanceCounterManager performanceCounterManager) { _trace = traceManager; _counters = performanceCounterManager; _broker = new MessageBroker(_topics, _counters) { Trace = Trace }; }
public TestScaleoutBus(int streams, IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions <MessageBusOptions> optionsAccessor, IOptions <ScaleoutOptions> scaleoutOptionsAccessor) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutOptionsAccessor) { _streams = streams; }
public ScaleoutStreamManager(Func <int, IList <Message>, Task> send, Action <int, ulong, ScaleoutMessage> receive, int streamCount, TraceSource trace, IPerformanceCounterManager performanceCounters, ScaleoutConfiguration configuration) : this(send, receive, streamCount, trace, performanceCounters, configuration, DefaultConfigurationManager.DefaultMaxScaleoutMappingsPerStream) { }
public LongPollingTransport(HostContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager, IConfigurationManager configurationManager) : base(context, jsonSerializer, heartbeat, performanceCounterManager, traceManager) { _configurationManager = configurationManager; }
protected ForeverTransport(HostContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterWriter, ITraceManager traceManager) : base(context, heartbeat, performanceCounterWriter, traceManager) { _jsonSerializer = jsonSerializer; _counters = performanceCounterWriter; }
private TestLongPollingTransport( HostContext context, JsonSerializer json, ITransportHeartbeat heartBeat, IPerformanceCounterManager counters, ITraceManager traceManager, IConfigurationManager configuarionManager) : base(context, json, heartBeat, counters, traceManager, configuarionManager) { }
public ForeverFrameTransport(HttpContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterWriter, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IMemoryPool pool) : base(context, jsonSerializer, heartbeat, performanceCounterWriter, applicationLifetime, loggerFactory, pool) { }
public LongPollingTransport(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager) : base(context, heartbeat, performanceCounterManager, traceManager) { _jsonSerializer = jsonSerializer; _counters = performanceCounterManager; }
public WebSocketTransport(HttpContext context, JsonSerializer serializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IMemoryPool pool) : this(context, serializer, heartbeat, performanceCounterManager, applicationLifetime, loggerFactory, pool, maxIncomingMessageSize : null) { }
public WebSocketTransport(HttpContext context, JsonSerializer serializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IMemoryPool pool) : this(context, serializer, heartbeat, performanceCounterManager, applicationLifetime, loggerFactory, pool, maxIncomingMessageSize: null) { }
private TestLongPollingTransport( HostContext context, JsonSerializer json, ITransportHeartbeat heartBeat, IPerformanceCounterManager counters, ITraceManager traceManager, IConfigurationManager configurationManager) : base(context, json, heartBeat, counters, traceManager, configurationManager, new MemoryPool()) { }
public MessageBus(IStringMinifier stringMinifier, ITraceManager traceManager, IPerformanceCounterManager performanceCounterManager, IConfigurationManager configurationManager, int maxTopicsWithNoSubscriptions) { if (stringMinifier == null) { throw new ArgumentNullException("stringMinifier"); } if (traceManager == null) { throw new ArgumentNullException("traceManager"); } if (performanceCounterManager == null) { throw new ArgumentNullException("performanceCounterManager"); } if (configurationManager == null) { throw new ArgumentNullException("configurationManager"); } if (configurationManager.DefaultMessageBufferSize < 0) { throw new ArgumentOutOfRangeException(Resources.Error_BufferSizeOutOfRange); } _stringMinifier = stringMinifier; _traceManager = traceManager; Counters = performanceCounterManager; _trace = _traceManager["SignalR." + typeof(MessageBus).Name]; _maxTopicsWithNoSubscriptions = maxTopicsWithNoSubscriptions; _gcTimer = new Timer(_ => GarbageCollectTopics(), state: null, dueTime: _gcInterval, period: _gcInterval); _broker = new MessageBroker(Counters) { Trace = _trace }; // The default message store size _messageStoreSize = (uint)configurationManager.DefaultMessageBufferSize; _topicTtl = configurationManager.TopicTtl(); _createTopic = CreateTopic; _addEvent = AddEvent; _removeEvent = RemoveEvent; _disposeSubscription = o => DisposeSubscription(o); Topics = new TopicLookup(); }
protected ScaleoutMessageBus(IStringMinifier stringMinifier, ILoggerFactory loggerFactory, IPerformanceCounterManager performanceCounterManager, IOptions<MessageBusOptions> optionsAccessor, IOptions<ScaleoutOptions> scaleoutOptionsAccessor) : base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor) { _logger = loggerFactory.CreateLogger<ScaleoutMessageBus>(); _perfCounters = performanceCounterManager; _streamManager = new Lazy<ScaleoutStreamManager>(() => new ScaleoutStreamManager(Send, OnReceivedCore, StreamCount, _logger, _perfCounters, scaleoutOptionsAccessor.Value)); }
public ServerSentEventsTransport(HttpContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IMemoryPool pool) : base(context, jsonSerializer, heartbeat, performanceCounterManager, applicationLifetime, loggerFactory, pool) { _counters = performanceCounterManager; }
public WebSocketTransport(HostContext context, JsonSerializer serializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterWriter, ITraceManager traceManager) : base(context, serializer, heartbeat, performanceCounterWriter, traceManager) { _context = context; _message = OnMessage; _closed = OnClosed; _error = OnError; }
protected ForeverTransport(HttpContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IMemoryPool pool) : base(context, heartbeat, performanceCounterManager, applicationLifetime, loggerFactory, pool) { _jsonSerializer = jsonSerializer; _counters = performanceCounterManager; }
public LongPollingTransport(HttpContext context, JsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IOptions<SignalROptions> optionsAccessor, IMemoryPool pool) : base(context, jsonSerializer, heartbeat, performanceCounterManager, applicationLifetime, loggerFactory, pool) { _pollDelay = optionsAccessor.Value.Transports.LongPolling.PollDelay; _counters = performanceCounterManager; }
protected ScaleoutMessageBus(IDependencyResolver resolver, ScaleoutConfiguration configuration) : base(resolver) { if (configuration == null) { throw new ArgumentNullException("configuration"); } var traceManager = resolver.Resolve<ITraceManager>(); _trace = traceManager["SignalR." + typeof(ScaleoutMessageBus).Name]; _perfCounters = resolver.Resolve<IPerformanceCounterManager>(); _streamManager = new Lazy<ScaleoutStreamManager>(() => new ScaleoutStreamManager(Send, OnReceivedCore, StreamCount, _trace, _perfCounters, configuration)); }