public static void Main(string[] args) { var lighthouseService = new LighthouseService(); lighthouseService.Start(); Console.WriteLine("Press Control + C to terminate."); Console.CancelKeyPress += async(sender, eventArgs) => { await lighthouseService.StopAsync(); }; lighthouseService.TerminationHandle.Wait(); }
public static void Run(string[] args, bool runAsService = false) { _lighthouseService = new LighthouseService(); _lighthouseService.Start(); if (runAsService) { return; } Console.WriteLine("Press Control + C to terminate."); Console.CancelKeyPress += async(sender, eventArgs) => { await _lighthouseService.StopAsync(); }; _lighthouseService.TerminationHandle.Wait(); }
private static void Main(string[] args) { Print.Line(ConsoleColor.Yellow); Print.Message("LIGHTHOUSE", ConsoleColor.Yellow); Print.Line(ConsoleColor.Yellow); var lighthouseService = new LighthouseService(actorSystemName: Constants.SystemName); lighthouseService.Start(); Console.WriteLine("Press Control + C to terminate."); Console.CancelKeyPress += async(sender, eventArgs) => { await lighthouseService.StopAsync(); }; lighthouseService.TerminationHandle.Wait(); }
public static void Main(string[] args) { Console.Title = "Lighthouse"; // Some biolerplate to react to close window event, CTRL-C, kill, etc if (Environment.UserInteractive) { _handler += new EventHandler(Handler); SetConsoleCtrlHandler(_handler, true); } var lighthouseService = new LighthouseService(); lighthouseService.Start(); Console.WriteLine("Press Control + C to terminate."); Console.CancelKeyPress += async(sender, eventArgs) => { await lighthouseService.StopAsync(); }; lighthouseService.TerminationHandle.Wait(); }