示例#1
0
        public async Task <BaseCommand> Send(CommandLookupTopic command, CancellationToken cancellationToken)
        {
            ThrowIfDisposed();

            Task <BaseCommand>?responseTask;

            using (await _lock.Lock(cancellationToken).ConfigureAwait(false))
            {
                responseTask = _channelManager.Outgoing(command);
                var sequence = Serializer.Serialize(command.AsBaseCommand());
                await _stream.Send(sequence).ConfigureAwait(false);
            }

            return(await responseTask.ConfigureAwait(false));
        }
示例#2
0
 public Task <BaseCommand> Send(CommandLookupTopic command, CancellationToken cancellationToken)
 => SendRequestResponse(command.AsBaseCommand(), cancellationToken);
示例#3
0
 public async Task <BaseCommand> Send(CommandLookupTopic command) => await SendRequestResponse(command.AsBaseCommand());