Example #1
0
        public override async Task EnableReceiveMessageAsync(CancellationToken cancellationToken)
        {
            Logging.Enter(this, cancellationToken, nameof(EnableReceiveMessageAsync));

            try
            {
                cancellationToken.ThrowIfCancellationRequested();
                await _amqpUnit.EnableReceiveMessageAsync(_operationTimeout).ConfigureAwait(false);
            }
            finally
            {
                Logging.Exit(this, cancellationToken, nameof(EnableReceiveMessageAsync));
            }
        }
        public override async Task EnableReceiveMessageAsync(CancellationToken cancellationToken)
        {
            if (Logging.IsEnabled)
            {
                Logging.Enter(this, cancellationToken, nameof(EnableReceiveMessageAsync));
            }

            try
            {
                cancellationToken.ThrowIfCancellationRequested();

                using var ctb = new CancellationTokenBundle(_operationTimeout, cancellationToken);
                await _amqpUnit.EnableReceiveMessageAsync(ctb.Token).ConfigureAwait(false);
            }
            finally
            {
                if (Logging.IsEnabled)
                {
                    Logging.Exit(this, cancellationToken, nameof(EnableReceiveMessageAsync));
                }
            }
        }