Beispiel #1
0
 public Task Create(BackgroundServerContext context, CancellationToken token)
 {
     return(Task.Run(() =>
     {
         using (_factory.Create())
         {
             token.WaitHandle.WaitOne();
         }
     }, token));
 }
Beispiel #2
0
        public void Handle(HostArguments args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            using (_serverFactory.Create())
            {
                _shutdown.WaitForShutdown();
            }
        }