示例#1
0
 public DirectBus(IRouteMessages routeMessages)
 {
     _routeMessages   = routeMessages;
     _preCommitQueue  = new Queue <object>(32);
     _postCommitQueue = new InMemoryQueue();
     _postCommitQueue.Pop(DoPublish);
 }
示例#2
0
 public DirectBus(IRouteMessages routeMessages)
 {
     _routeMessages = routeMessages;
     _preCommitQueue = new Queue<object>(32);
     _postCommitQueue = new InMemoryQueue();
     _postCommitQueue.Pop(DoPublish);
 }
示例#3
0
        public void When_adding_listeners_to_the_queue_they_can_later_be_executed_with_new_items_from_the_queue()
        {
            var firstItem = "not set";
            var secondItem = "not set";

            var inMemoryQueue = new InMemoryQueue();

            inMemoryQueue.Pop(x => firstItem = x.ToString());
            inMemoryQueue.Pop(x => secondItem = x.ToString());

            Assert.That(firstItem, Is.EqualTo("not set"));
            Assert.That(secondItem, Is.EqualTo("not set"));

            inMemoryQueue.Put("first item");
            inMemoryQueue.Put("second item");

            Assert.That(firstItem, Is.EqualTo("first item"));
            Assert.That(secondItem, Is.EqualTo("second item"));
        }