public Task Create(BackgroundServerContext context, CancellationToken token) { return(Task.Run(() => { using (_factory.Create()) { token.WaitHandle.WaitOne(); } }, token)); }
public void Handle(HostArguments args) { if (args == null) { throw new ArgumentNullException(nameof(args)); } string url = EnsureUrl(args, out _); using (_factory.Create(url)) { if (Environment.UserInteractive && !args.CommandArgs.Contains("noBrowser")) { Process.Start(url); } _shutdown.WaitForShutdown(); } }