Esempio n. 1
0
        public RabbitMqConnectionFactory(IOptions <RabbitMqOptions> options,
                                         RabbitMqConnectionPool pool)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (pool == null)
            {
                throw new ArgumentNullException(nameof(pool));
            }

            _options = options;
            _pool    = pool;
        }
        public RabbitMqConnection(string id, IConnection connection,
                                  RabbitMqConnectionPool pool,
                                  IOptions <RabbitMqOptions> options)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (pool == null)
            {
                throw new ArgumentNullException(nameof(pool));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options             = options;
            _channels            = new ConcurrentQueue <IModel>();
            _pool                = pool;
            ConnectionId         = id;
            UnderlyingConnection = connection;
        }