internal void Redispatch(MessageDispatchChannel channel) { MessageDispatch[] messages = channel.RemoveAll(); System.Array.Reverse(messages); foreach (MessageDispatch message in messages) { this.executor.ExecuteFirst(message); } }
internal void Redispatch(MessageDispatchChannel channel) { MessageDispatch[] messages = channel.RemoveAll(); System.Array.Reverse(messages); foreach (MessageDispatch message in messages) { if (Tracer.IsDebugEnabled) { Tracer.DebugFormat("Resending Message Dispatch: ", message.ToString()); } this.executor.ExecuteFirst(message); } }
public void TestRemoveAll() { MessageDispatchChannel channel = new MessageDispatchChannel(); MessageDispatch dispatch1 = new MessageDispatch(); MessageDispatch dispatch2 = new MessageDispatch(); MessageDispatch dispatch3 = new MessageDispatch(); channel.Enqueue(dispatch1); channel.Enqueue(dispatch2); channel.Enqueue(dispatch3); channel.Start(); Assert.IsTrue(channel.Running == true); Assert.IsTrue(channel.Empty == false); Assert.IsTrue(channel.Count == 3); Assert.IsTrue(channel.RemoveAll().Length == 3); Assert.IsTrue(channel.Count == 0); Assert.IsTrue(channel.Empty == true); }
internal void Redispatch(MessageDispatchChannel channel) { MessageDispatch[] messages = channel.RemoveAll(); System.Array.Reverse(messages); foreach(MessageDispatch message in messages) { this.executor.ExecuteFirst(message); } }