예제 #1
0
 public async Task PushAsync(CancellationToken cancellationToken, TInput input, PipelineMetadata metadata)
 {
     if (_following != null)
     {
         await _following.PushAsync(cancellationToken, input, metadata).ConfigureAwait(false);
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }