コード例 #1
0
        public ConsumerWorkflow <TState> WithFinalization(Action <TState> action, int?maxDoPOverride = null, bool?ensureOrdered = null, int?bufferSizeOverride = null)
        {
            Guard.AgainstNull(_encryptionProvider, nameof(_encryptionProvider));
            var executionOptions = GetExecuteStepOptions(maxDoPOverride, ensureOrdered, bufferSizeOverride);

            _finalization = BlockBuilders.GetWrappedActionBlock <TState>(action, executionOptions);
            return(this);
        }
コード例 #2
0
        public ConsumerWorkflow <TState> WithErrorHandling(Action <TState> action, int bufferCapacity, int?maxDoPOverride = null, bool?ensureOrdered = null)
        {
            _errorBuffer = new BufferBlock <TState>(new DataflowBlockOptions {
                BoundedCapacity = bufferCapacity > 0 ? bufferCapacity : 1000
            });
            var executionOptions = GetExecuteStepOptions(maxDoPOverride, ensureOrdered, bufferCapacity);

            _errorAction = BlockBuilders.GetWrappedActionBlock(action, executionOptions);
            return(this);
        }