Exemple #1
0
        public void OnStart(StageArgs args)
        {
            _startup = args.TryGetInstance <IStartup>();

            if (_startup == null)
            {
                throw new StartupNotFoundException();
            }

            _startup.Execute(new ServiceArgs(args.StartArgs, () => false));
        }
Exemple #2
0
        public AsyncRunnerStage()
        {
            _source = new CancellationTokenSource();

            _runner = new Task(() =>
            {
                try
                {
                    _startup.Execute(_serviceArgs);
                }
                catch (TaskCanceledException)
                {
                }
            }, _source.Token);
        }