public async Task PushAsync(CancellationToken cancellationToken, TInput input, PipelineMetadata metadata) { if (_following != null) { await _following.PushAsync(cancellationToken, input, metadata).ConfigureAwait(false); } }
private async Task SendBatchedDataAsync(CancellationToken cancellationToken, PipelineMetadata metadata) { var task = _next?.PushAsync(cancellationToken, _batch.ToImmutableArray(), metadata); _batch.Clear(); _bufferedCount = 0; if (task != null) { await task.ConfigureAwait(false); } }
public async Task PushAsync(CancellationToken cancellationToken, TInput input, PipelineMetadata metadata) { if (_positive == null && _negative == null) { throw new InvalidOperationException("Decision block should have at least one branch"); } var condition = await _condition(cancellationToken, input, metadata).ConfigureAwait(false); var task = condition ? _positive?.PushAsync(cancellationToken, input, metadata) : _negative?.PushAsync(cancellationToken, input, metadata); if (task != null) { await task.ConfigureAwait(false); } }