コード例 #1
0
ファイル: LighthouseProgram.cs プロジェクト: nesfit/NTPAC
 private static async Task RunLighthouse(LighthouseCliOptions opts)
 {
     var hostBuilder = new HostBuilder().ConfigureServices((hostContext, services) =>
     {
         services.AddSingleton <IHostedService, LighthouseService>(
             provider => new LighthouseService(opts.ClusterNodeHostname, opts.ClusterNodePort));
     });
     await hostBuilder.RunConsoleAsync().ConfigureAwait(false);
 }
コード例 #2
0
ファイル: LighthouseProgram.cs プロジェクト: nesfit/NTPAC
        private static async Task Main(String[] args)
        {
            LighthouseCliOptions cliOptions = null;

            Parser.Default.ParseArguments <LighthouseCliOptions>(args).WithParsed(options => cliOptions = options);
            if (cliOptions == null)
            {
                return;
            }
            await RunLighthouse(cliOptions).ConfigureAwait(false);
        }