Shows how you can block processing until a message arrives, or until a timeout fires
Inheritance: IDisposable
        public void ServiceStartsButNoDataArrives()
        {
            var bus = RabbitHutch.CreateBus("host=localhost");

            // this is the service that sends the data. It waits for a data request and then
            // publishes some data
            bus.Subscribe<RequestDataMessage>("data_service", _ =>
            {
                // don't send any data
            });

            var myService = new MyService(bus);

            myService.Start();

            // should expect to see "Timeout occured"
            myService.Process();

            myService.Dispose();
            bus.Dispose();
        }
        public void ServiceStartsWithTimelyResponse()
        {
            var bus = RabbitHutch.CreateBus("host=localhost");

            // this is the service that sends the data. It waits for a data request and then
            // publishes some data
            bus.Subscribe<RequestDataMessage>("data_service", _ =>
            {
                bus.Publish(new DataMessage{ Text = "The message full of data" });
            });

            var myService = new MyService(bus);

            myService.Start();

            // should expect to see "Got text: 'The message full of data'"
            myService.Process();

            myService.Dispose();
            bus.Dispose();
        }
        public void ServiceStartsWithTimelyResponse()
        {
            var bus = RabbitHutch.CreateBus("host=localhost");

            // this is the service that sends the data. It waits for a data request and then
            // publishes some data
            bus.Subscribe <RequestDataMessage>("data_service", _ =>
            {
                bus.Publish(new DataMessage {
                    Text = "The message full of data"
                });
            });

            var myService = new MyService(bus);

            myService.Start();

            // should expect to see "Got text: 'The message full of data'"
            myService.Process();

            myService.Dispose();
            bus.Dispose();
        }