Inheritance: EventStore.Core.Messaging.Message, IFlushableMessage, IMasterWriteMessage
Ejemplo n.º 1
0
        public void Test()
        {
            var fsm = CreateFSM();
            var msg = new StorageMessage.WriteCommit(Guid.NewGuid(), new NoopEnvelope(), 0);
            const int iterations = 1000000;

            var sw = Stopwatch.StartNew();

            for (int i = 0; i < iterations; ++i)
            {
                fsm.Handle(msg);
            }

            sw.Stop();

            Console.WriteLine("Elapsed: {0} ({1} per item).", sw.Elapsed, sw.ElapsedMilliseconds / (float)iterations);
        }
Ejemplo n.º 2
0
        public void Test2()
        {
            var bus = new InMemoryBus("a", true);
            bus.Subscribe(new AdHocHandler<StorageMessage.WriteCommit>(x => { }));
            bus.Subscribe(new AdHocHandler<Message>(x => { }));

            var msg = new StorageMessage.WriteCommit(Guid.NewGuid(), new NoopEnvelope(), 0);
            const int iterations = 1000000;

            var sw = Stopwatch.StartNew();

            for (int i = 0; i < iterations; ++i)
            {
                bus.Handle(msg);
            }

            sw.Stop();

            Console.WriteLine("Elapsed: {0} ({1} per item).", sw.Elapsed, sw.ElapsedMilliseconds / (float)iterations);
        }