public void OnStart(StageArgs args) { _startup = args.TryGetInstance <IStartup>(); if (_startup == null) { throw new StartupNotFoundException(); } _startup.Execute(new ServiceArgs(args.StartArgs, () => false)); }
public AsyncRunnerStage() { _source = new CancellationTokenSource(); _runner = new Task(() => { try { _startup.Execute(_serviceArgs); } catch (TaskCanceledException) { } }, _source.Token); }