public ProfilerLoggerThroughput()
 {
     var ms = new MemoryStream();
     var sw = new StreamWriter(ms);
     _vane = Vane.Success(new Logger<Subject>(sw, x => ""),
         new Profiler<Subject>(sw, TimeSpan.FromMilliseconds(2)));
 }
        public ControllerRoutingThroughput()
        {
            Vane<RoutingContext> routeVane = VaneFactory.Success<RoutingContext>();

            var constant = new ConstantFeather(1);
            var vane0 = VaneFactory.New<RoutingContext>(x => x.Feather(() => constant));
            var join1 = new JoinFeather(2, 1, routeVane);
            var vane1 = VaneFactory.New<RoutingContext>(x => x.Feather(() => join1));

            var segment0 = new SegmentSourceVane(0);

            var dictionary0 = new Dictionary<string, Vane<Tuple<RoutingContext, string>>>();
            dictionary0.Add("/", new LeftVane<RoutingContext, string>(vane0));

            var dictionaryVane0 = VaneFactory.New<Tuple<RoutingContext, string>>(x =>
                x.Feather(() => new DictionaryFeather(dictionary0)));

            var segment0Vane = new SpliceSourceFeather<RoutingContext, string>(dictionaryVane0, segment0);

            var segment1 = new SegmentSourceVane(1);

            var dictionary1 = new Dictionary<string, Vane<Tuple<RoutingContext, string>>>();
            dictionary1.Add("Accounts/", new LeftVane<RoutingContext, string>(vane1));

            var dictionaryVane1 = VaneFactory.New<Tuple<RoutingContext, string>>(x =>
                x.Feather(() => new DictionaryFeather(dictionary1)));

            var segment1Vane = new SpliceSourceFeather<RoutingContext, string>(dictionaryVane1, segment1);

            _vane = VaneFactory.New<RoutingContext>(x =>
                {
                    x.Feather(() => segment0Vane);
                    x.Feather(() => segment1Vane);
                });
        }
 public TransactionProfilerLoggerThroughput()
 {
     var ms = new MemoryStream();
     var sw = new StreamWriter(ms);
     _vane = VaneFactory.Success(new LogFeather<Subject>(sw, x => ""),
         new ProfilerFeather<Subject>(sw, TimeSpan.FromMilliseconds(2)),
         new TransactionFeather<Subject>());
 }
        public ProfilerLoggerThroughput()
        {
            var ms = new MemoryStream();
            var sw = new StreamWriter(ms);

            _vane = VaneFactory.New<Subject>(x =>
                {
                    x.Log(l => l.SetOutput(sw).SetFormat(p => ""));
                    x.Profiler(p => p.SetOutput(sw).Threshold(2));
                });
        }
        public TupleConsumerThroughput()
        {
            Vane<Message> vane = VaneFactory.New<Message>(x =>
            {
                x.Consumer(() => new TestConsumer(), xc =>
                {
                    xc.Consume<Subject>(c => c.Consume);
                });
            });

            var messageVane = new MessageTypeFeather<Subject>(vane);

            var fanOutVane = new FanoutFeather<Message>(new[] {messageVane});

            _vane = VaneFactory.Success(fanOutVane);
        }
예제 #6
0
        public void Setup()
        {
            var messageConsumerVane = new MessageConsumerFeather<A, WorkingConsumer>(x => x.Consume);
            Vane<Tuple<Message<A>, WorkingConsumer>> consumerVane = VaneFactory.Success(messageConsumerVane);

            var messageConsumerVaneB = new MessageConsumerFeather<B, WorkingConsumer>(x => x.Consume);
            Vane<Tuple<Message<B>, WorkingConsumer>> consumerVaneB = VaneFactory.Success(messageConsumerVaneB);

            var factoryVane = new FactorySourceVane<WorkingConsumer>(() => new WorkingConsumer());
            var loggerVane = new LogFeather<WorkingConsumer>(Console.Out, x => "Logging");
            var profilerVane = new ProfilerFeather<WorkingConsumer>(Console.Out, TimeSpan.FromMilliseconds(1));

            var sourceVane = VaneFactory.Source(factoryVane, loggerVane, profilerVane);
            var spliceVane = new SpliceFeather<Message<A>, WorkingConsumer>(consumerVane, sourceVane);

            var messageVane = new MessageTypeFeather<A>(VaneFactory.Success(spliceVane));

            var spliceVaneB = new SpliceFeather<Message<B>, WorkingConsumer>(consumerVaneB, sourceVane);
            var messageVaneB = new MessageTypeFeather<B>(VaneFactory.Success(spliceVaneB));

            var fanOutVane = new FanoutFeather<Message>(new Feather<Message>[] { messageVane, messageVaneB });

            _vane = VaneFactory.Success(fanOutVane);
        }
예제 #7
0
 public AsyncThroughput()
 {
     var executeVane = new ExecuteTaskFeather<Subject>(x => Task.Factory.StartNew(() => { }));
     _vane = VaneFactory.Success(executeVane);
 }
예제 #8
0
 public EmptyThroughput()
 {
     _vane = VaneFactory.Success<Subject>();
 }
예제 #9
0
 public LoggerThroughput()
 {
     var ms = new MemoryStream();
     var sw = new StreamWriter(ms);
     _vane = VaneFactory.Success(new LogFeather<Subject>(sw, x => ""));
 }
예제 #10
0
 public HttpServer(Uri uri, Vane<ConnectionContext> vane)
 {
     _uri = uri;
     _vane = vane;
 }