public Task <BaseCommand> Outgoing(CommandSeek command) { using (TakeConsumerSenderLock(command.ConsumerId)) { return(_requestResponseHandler.Outgoing(command)); } }
public static BaseCommand ToBaseCommand(this CommandSeek value) { return(new BaseCommand { type = BaseCommand.Type.Seek, Seek = value }); }
public async Task Send(CommandSeek command, CancellationToken cancellationToken) { command.ConsumerId = _id; var response = await _connection.Send(command, cancellationToken).ConfigureAwait(false); response.Expect(BaseCommand.Type.Success); _batchHandler.Clear(); }
public static BaseCommand AsBaseCommand(this CommandSeek command) { return(new BaseCommand { CommandType = BaseCommand.Type.Seek, Seek = command }); }
public async ValueTask Seek(MessageId messageId, CancellationToken cancellationToken) { ThrowIfDisposed(); var seek = new CommandSeek { MessageId = messageId.ToMessageIdData() }; await _executor.Execute(() => Seek(seek, cancellationToken), cancellationToken).ConfigureAwait(false); }
public async ValueTask Seek(ulong publishTime, CancellationToken cancellationToken) { ThrowIfDisposed(); var seek = new CommandSeek { MessagePublishTime = publishTime }; await _executor.Execute(() => Seek(seek, cancellationToken), cancellationToken).ConfigureAwait(false); }
public async Task <CommandSuccess> Send(CommandSeek command) { command.ConsumerId = _id; var response = await _connection.Send(command); response.Expect(BaseCommand.Type.Success); _batchHandler.Clear(); return(response.Success); }
public async ValueTask Seek(DateTimeOffset publishTime, CancellationToken cancellationToken) { ThrowIfDisposed(); var seek = new CommandSeek { MessagePublishTime = (ulong)publishTime.ToUnixTimeMilliseconds() }; _ = await _executor.Execute(() => Seek(seek, cancellationToken), cancellationToken).ConfigureAwait(false); }
public async ValueTask Seek(MessageId messageId, CancellationToken cancellationToken) { var seek = new CommandSeek { MessageId = messageId.Data }; _ = await _executor.Execute(() => Stream.Send(seek), cancellationToken); return; }
public async ValueTask Seek(MessageId messageId, CancellationToken cancellationToken) { ThrowIfDisposed(); var seek = new CommandSeek { MessageId = messageId.Data }; _ = await _executor.Execute(() => _channel.Send(seek), cancellationToken); return; }
public static ReadOnlySequence <byte> NewSeek(long consumerId, long requestId, long timestamp) { var seek = new CommandSeek { ConsumerId = (ulong)consumerId, RequestId = (ulong)requestId, MessagePublishTime = (ulong)timestamp }; return(Serializer.Serialize(seek.ToBaseCommand())); }
public static ReadOnlySequence <byte> NewSeek(long consumerId, long requestId, long ledgerId, long entryId, long[] ackSet) { var seek = new CommandSeek { ConsumerId = (ulong)consumerId, RequestId = (ulong)requestId }; var messageId = new MessageIdData { ledgerId = (ulong)ledgerId, entryId = (ulong)entryId, AckSets = ackSet }; seek.MessageId = messageId; return(Serializer.Serialize(seek.ToBaseCommand())); }
public async Task <BaseCommand> Send(CommandSeek 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)); }
public async Task <CommandSuccess> Send(CommandSeek command) { try { command.ConsumerId = _id; var response = await _connection.Send(command); response.Expect(BaseCommand.Type.Success); _batchHandler.Clear(); return(response.Success); } catch (Exception exception) { OnException(exception); throw; } }
private async Task Seek(CommandSeek command, CancellationToken cancellationToken) => await _channel.Send(command, cancellationToken).ConfigureAwait(false);
public Task <BaseCommand> Outgoing(CommandSeek command) { command.RequestId = _requestId.FetchNext(); return(_requests.CreateTask(StandardRequest.WithConsumerId(command.RequestId, command.ConsumerId, BaseCommand.Type.Seek))); }
public Task <BaseCommand> Send(CommandSeek command, CancellationToken cancellationToken) => SendRequestResponse(command.AsBaseCommand(), cancellationToken);
public Task <CommandSuccess> Send(CommandSeek command, CancellationToken cancellationToken) => throw GetException();
public Task <CommandSuccess> Send(CommandSeek command) => throw GetException();
public async Task <BaseCommand> Send(CommandSeek command) => await SendRequestResponse(command.AsBaseCommand());