public static PipeDelegate <T> GetHandler <T>() where T : class
        {
            if (!Services.TryGetValue(typeof(T), out var services))
            {
                throw new InvalidOperationException($"type {typeof(T).FullName} is not configure");
            }

            return(PipeBuilder.Build <T>(services));
        }
Beispiel #2
0
        public IPipe <TContext> Build()
        {
            var builder = new PipeBuilder <TContext>(_specifications.Count);

            var count = _specifications.Count;

            for (var index = 0; index < count; index++)
            {
                _specifications[index].Apply(builder);
            }

            return(builder.Build());
        }
        public IPipe <TContext> Build()
        {
            ValidatePipeConfiguration();

            var builder = new PipeBuilder <TContext>();

            foreach (IPipeSpecification <TContext> configurator in _specifications)
            {
                configurator.Apply(builder);
            }

            return(builder.Build());
        }
        public IConsumePipe BuildConsumePipe()
        {
            var filter = new DynamicFilter <ConsumeContext, Guid>(new ConsumeContextConverterFactory(), GetRequestId);

            var builder = new PipeBuilder <ConsumeContext>();

            foreach (IPipeSpecification <ConsumeContext> specification in _consumeContextSpecifications)
            {
                specification.Apply(builder);
            }

            builder.AddFilter(filter);

            return(new ConsumePipe(filter, builder.Build()));
        }
Beispiel #5
0
        public IConsumePipe Build()
        {
            _pipeBuilder.AddFilter(_filter);

            return(new ConsumePipe(_filter, _pipeBuilder.Build()));
        }
Beispiel #6
0
        public ISendPipe Build()
        {
            _pipeBuilder.AddFilter(_messageTypeSendFilter);

            return(new SendPipe(_messageTypeSendFilter, _pipeBuilder.Build()));
        }
        public IConsumePipe Build()
        {
            _pipeBuilder.AddFilter(_messageTypeConsumeFilter);

            return(new ConsumePipe(_messageTypeConsumeFilter, _pipeBuilder.Build()));
        }
Beispiel #8
0
        public IPublishPipe Build()
        {
            _pipeBuilder.AddFilter(_messageTypePublishFilter);

            return(new PublishPipe(_messageTypePublishFilter, _pipeBuilder.Build()));
        }