Ejemplo n.º 1
0
        public ConsumerChannel(
            ulong id,
            uint messagePrefetchCount,
            AsyncQueue <MessagePackage> queue,
            IConnection connection,
            BatchHandler batchHandler)
        {
            _id           = id;
            _queue        = queue;
            _connection   = connection;
            _batchHandler = batchHandler;

            _lock = new AsyncLock();

            _cachedCommandFlow = new CommandFlow
            {
                ConsumerId     = id,
                MessagePermits = messagePrefetchCount
            };

            _sendWhenZero = 0;
            _firstFlow    = true;
        }