Example #1
0
            public MyConsumer(Fiber fiber)
            {
                _fiber = fiber;

                Called         = new Stact.Future <MyCommand>();
                CommandChannel = new ConsumerChannel <MyCommand>(_fiber, HandleMyCommand);
            }
Example #2
0
			public MyConsumer(Fiber fiber)
			{
				_fiber = fiber;

				Called = new Stact.Future<MyCommand>();
				CommandChannel = new ConsumerChannel<MyCommand>(_fiber, HandleMyCommand);
			}
Example #3
0
		public void Should_result_in_the_proper_message_data_arriving()
		{
			var message = new TestMessage {Id = CombGuid.Generate(), Name = "Chris"};

			var future = new Stact.Future<TestMessage>();

			var consumerChannel = new ConsumerChannel<TestMessage>(new SynchronousFiber(), future.Complete);
			var deserializeChannel = new DeserializeChannel<TestMessage>(new SynchronousFiber(), new FastTextSerializer(),
			                                                             consumerChannel);
			var serializeChannel = new SerializeChannel<TestMessage>(new SynchronousFiber(), new FastTextSerializer(),
			                                                         deserializeChannel);

			serializeChannel.Send(message);

			future.IsCompleted.ShouldBeTrue();
			future.Value.ShouldNotBeTheSameAs(message);
			future.Value.ShouldEqual(message);
		}
        public void Should_result_in_the_proper_message_data_arriving()
        {
            var message = new TestMessage {
                Id = CombGuid.Generate(), Name = "Chris"
            };

            var future = new Stact.Future <TestMessage>();

            var consumerChannel    = new ConsumerChannel <TestMessage>(new SynchronousFiber(), future.Complete);
            var deserializeChannel = new DeserializeChannel <TestMessage>(new SynchronousFiber(), new FastTextSerializer(),
                                                                          consumerChannel);
            var serializeChannel = new SerializeChannel <TestMessage>(new SynchronousFiber(), new FastTextSerializer(),
                                                                      deserializeChannel);

            serializeChannel.Send(message);

            future.IsCompleted.ShouldBeTrue();
            future.Value.ShouldNotBeTheSameAs(message);
            future.Value.ShouldEqual(message);
        }