protected override void OnStart(string[] args) { plugins.ForEach(p => { log.Debug($"Запуск {(p.IsSync ? "синхронного" : "асинхронного")} обработчика для кода запроса \"{p.RequestCode}\""); processHostManager.Add(p.RequestCode, p.IsSync); }); log.Info("Служба запущена"); }
/// <summary> /// Process single plugin. Method for debugging mostly. /// </summary> /// <param name="processHostManager">RabbitMQ Instance</param> /// <param name="requestCode">Reqeust code number to be processed</param> private static void SingleRequestCodeProcessing(ProcessHostManager processHostManager, int requestCode) { processHostManager.Add(requestCode, IsSync); Console.WriteLine($"Processing RequestCode {requestCode}"); Console.WriteLine("Press [enter] to stop."); Console.ReadLine(); processHostManager.Remove(requestCode, IsSync); }