public void Publish(string pluginName, IEventPublisher callback) { while (ququedEventsQueue.GetCount(pluginName) > 0) { var e = ququedEventsQueue.Peek(pluginName); if (RePublish(pluginName, e, callback)) { ququedEventsQueue.Dequeue(pluginName); } else { logger.Warn("Can not send event {0} for plugin {1} so this loop was break.", e, pluginName); break; } } }