Subscribe() 개인적인 메소드

private Subscribe ( ServiceBusConnectionContext connectionContext ) : void
connectionContext ServiceBusConnectionContext
리턴 void
예제 #1
0
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            // Retrieve the trace manager
            var         traceManager = resolver.Resolve <ITraceManager>();
            TraceSource trace        = traceManager["SignalR." + typeof(ServiceBusMessageBus).Name];

            _connection = new ServiceBusConnection(configuration, trace);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                      .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                      .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
예제 #2
0
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            // Retrieve the trace manager
            var traceManager = resolver.Resolve<ITraceManager>();
            TraceSource trace = traceManager["SignalR." + typeof(ServiceBusMessageBus).Name];

            _connection = new ServiceBusConnection(configuration, trace);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                                .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                                .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
예제 #3
0
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _connection = new ServiceBusConnection(configuration);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                      .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                      .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _connection = new ServiceBusConnection(configuration);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                                .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                                .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
예제 #5
0
 private void Subscribe(object state)
 {
     _connectionContext = _connection.Subscribe(_topics, OnMessage, OnError, Open);
 }
예제 #6
0
 private void Subscribe(object state)
 {
     _connection.Subscribe(_connectionContext);
 }