Ejemplo n.º 1
0
 public static void StopWorker()
 {
     if (_worker == null) return;
     if (HostingEnvironment.IsHosted)
     {
         HostingEnvironment.UnregisterObject(_worker);
     }
     _worker.Stop();
     _worker.Dispose(true);
     _worker = null;
 }
Ejemplo n.º 2
0
 private static void CreateAndStartWorker()
 {
     if (_worker != null)
     {
         throw new LingerException("Worker already exists, and was not properly stopped");
     }
     _worker = new LingerWorker(Concurrency);
     if (HostingEnvironment.IsHosted)
     {
         HostingEnvironment.RegisterObject(_worker);
     }
     _worker.Start();
 }
Ejemplo n.º 3
0
 private static void CreateAndStartWorker()
 {
     if(_worker != null)
     {
         throw new LingerException("Worker already exists, and was not properly stopped");
     }
     _worker = new LingerWorker(Concurrency);
     if (HostingEnvironment.IsHosted)
     {
         HostingEnvironment.RegisterObject(_worker);
     }
     _worker.Start();
 }
Ejemplo n.º 4
0
 public static void StopWorker()
 {
     if (_worker == null)
     {
         return;
     }
     if (HostingEnvironment.IsHosted)
     {
         HostingEnvironment.UnregisterObject(_worker);
     }
     _worker.Stop();
     _worker.Dispose(true);
     _worker = null;
 }