Example #1
0
 public DirectoryMonitor(string directory)
 {
     _baseDirectory = directory;
     _coordinatorChannel = AddressRegistry.GetOutboundCoordinatorChannel();
     _fiber = new ThreadPoolFiber();
 }
Example #2
0
        void Dispose(bool disposing)
        {
            if (_disposed)
                return;
            if (disposing)
            {
                if (_scheduler != null)
                    _scheduler.Stop();

                _fiber.Shutdown(30.Seconds());

                if (_producer != null)
                    _producer.Dispose();

                if (_coordinatorChannel != null)
                {
                    _coordinatorChannel.Dispose();
                    _coordinatorChannel = null;
                }
            }

            _disposed = true;
        }