public static void StopWorker() { if (_worker == null) return; if (HostingEnvironment.IsHosted) { HostingEnvironment.UnregisterObject(_worker); } _worker.Stop(); _worker.Dispose(true); _worker = null; }
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(); }
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(); }
public static void StopWorker() { if (_worker == null) { return; } if (HostingEnvironment.IsHosted) { HostingEnvironment.UnregisterObject(_worker); } _worker.Stop(); _worker.Dispose(true); _worker = null; }