Пример #1
0
        public void Start()
        {
            AssertNotDisposedOrDisposing();

            if (_wasStarted)
                throw new InvalidOperationException("The Start method may not be invoked more than once.");

            _receiver = new Receiver(_endpoint, AcceptMessages);
            _receiver.Start();

            _choke = new SendingChoke();
            _queuedMessagesSender = new QueuedMessagesSender(_queueStorage, _choke, _logger);
            _sendingThread = new Thread(_queuedMessagesSender.Send)
            {
                IsBackground = true,
                Name = "Lightning Queues Sender Thread for " + _path
            };
            _sendingThread.Start();
            _wasStarted = true;
        }
Пример #2
0
        public void Start()
        {
            AssertNotDisposedOrDisposing();

            if (_wasStarted)
            {
                throw new InvalidOperationException("The Start method may not be invoked more than once.");
            }

            _receiver = new Receiver(_endpoint, AcceptMessages);
            _receiver.Start();

            _choke = new SendingChoke();
            _queuedMessagesSender = new QueuedMessagesSender(_queueStorage, _choke, _logger);
            _sendingThread        = new Thread(_queuedMessagesSender.Send)
            {
                IsBackground = true,
                Name         = "Lightning Queues Sender Thread for " + _path
            };
            _sendingThread.Start();
            _wasStarted = true;
        }