Example #1
0
        /// <summary>
        /// Создать <see cref="MessageProcessor"/>.
        /// </summary>
        /// <param name="name">Название обработчика.</param>
        /// <param name="errorHandler">Обработчик ошибок.</param>
        public MessageProcessor(string name, Action <Exception> errorHandler)
        {
            if (name.IsEmpty())
            {
                throw new ArgumentNullException("name");
            }

            if (errorHandler == null)
            {
                throw new ArgumentNullException("errorHandler");
            }

            Name          = name;
            _errorHandler = errorHandler;
            _messageQueue.Close();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InMemoryMessageChannel"/>.
        /// </summary>
        /// <param name="name">Channel name.</param>
        /// <param name="errorHandler">Error handler.</param>
        public InMemoryMessageChannel(string name, Action <Exception> errorHandler)
        {
            if (name.IsEmpty())
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (errorHandler == null)
            {
                throw new ArgumentNullException(nameof(errorHandler));
            }

            Name = name;

            _errorHandler = errorHandler;
            _messageQueue.Close();
        }
Example #3
0
            public HistoryEmulationMessageChannel(HistoryMessageAdapter historyMessageAdapter, Action <Exception> errorHandler)
            {
                if (historyMessageAdapter == null)
                {
                    throw new ArgumentNullException(nameof(historyMessageAdapter));
                }

                if (errorHandler == null)
                {
                    throw new ArgumentNullException(nameof(errorHandler));
                }

                _historyMessageAdapter = historyMessageAdapter;
                _errorHandler          = errorHandler;

                _messageQueue.Close();
            }