encompasses all the logic for reloading observer.
355942
def logReload(options):
    
    event_handler = Reload(options)
    observer = Observer()
    observer.schedule(event_handler, path='.', recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
        pid = os.getpid()
        chalk.eraser()
        chalk.green('\nHendrix successfully closed.')
        os.kill(pid, 15)
    observer.join()
    exit('\n')
584129
def reload(self):
		
		oldlayers = self.layers
		self.layers = []
		for cp, filename, fp in oldlayers:
			cp = cp # pylint
			if fp is None:
				self.read(filename)
			else:
				self.readfp(fp, filename)
1207530
function(app, opts) {
  this.app = app;
  this.handlerMap = {};
  if(!!opts.reloadHandlers) {
    watchHandlers(app, this.handlerMap);
  }

  this.enableForwardLog = opts.enableForwardLog || false;
}
632375
def reload(self):
        
        for section in self.sections():
            self.remove_section(section)
        self.autoload()
1015824
def update(self, **kwargs):
        
        self.reload_context(es_based=False, **kwargs)
        return super(ESCollectionView, self).update(**kwargs)
770817
protected static function init_all_observers() {
        global $CFG;

        if (is_array(self::$allobservers)) {
            return;
        }

        if (!PHPUNIT_TEST and !during_initial_install()) {
            $cache = \cache::make('core', 'observers');
            $cached = $cache->get('all');
            $dirroot = $cache->get('dirroot');
            if ($dirroot === $CFG->dirroot and is_array($cached)) {
                self::$allobservers = $cached;
                return;
            }
        }

        self::$allobservers = array();

        $plugintypes = \core_component::get_plugin_types();
        $plugintypes = array_merge(array('core' => 'not used'), $plugintypes);
        $systemdone = false;
        foreach ($plugintypes as $plugintype => $ignored) {
            if ($plugintype === 'core') {
                $plugins['core'] = "$CFG->dirroot/lib";
            } else {
                $plugins = \core_component::get_plugin_list($plugintype);
            }

            foreach ($plugins as $plugin => $fulldir) {
                if (!file_exists("$fulldir/db/events.php")) {
                    continue;
                }
                $observers = null;
                include("$fulldir/db/events.php");
                if (!is_array($observers)) {
                    continue;
                }
                self::add_observers($observers, "$fulldir/db/events.php", $plugintype, $plugin);
            }
        }

        self::order_all_observers();

        if (!PHPUNIT_TEST and !during_initial_install()) {
            $cache->set('all', self::$allobservers);
            $cache->set('dirroot', $CFG->dirroot);
        }
    }
803266
def save(self, reload=False):
        """"""
        self.wrapper.raw.save()
        if reload:
            self.reload()
820081
protected static function reload()
    {
        // For master process.
        if (self::$_masterPid === posix_getpid()) {
            // Set reloading state.
            if (self::$_status !== self::STATUS_RELOADING && self::$_status !== self::STATUS_SHUTDOWN) {
                self::log("Workerman[" . basename(self::$_startFile) . "] reloading");
                self::$_status = self::STATUS_RELOADING;
                // Try to emit onMasterReload callback.
                if (self::$onMasterReload) {
                    try {
                        call_user_func(self::$onMasterReload);
                    } catch (\Exception $e) {
                        self::log($e);
                        exit(250);
                    } catch (\Error $e) {
                        self::log($e);
                        exit(250);
                    }
                    self::initId();
                }
            }

            // Send reload signal to all child processes.
            $reloadable_pid_array = array();
            foreach (self::$_pidMap as $worker_id => $worker_pid_array) {
                $worker = self::$_workers[$worker_id];
                if ($worker->reloadable) {
                    foreach ($worker_pid_array as $pid) {
                        $reloadable_pid_array[$pid] = $pid;
                    }
                } else {
                    foreach ($worker_pid_array as $pid) {
                        // Send reload signal to a worker process which reloadable is false.
                        swoole_process::kill($pid, SIGUSR1);
                    }
                }
            }

            // Get all pids that are waiting reload.
            self::$_pidsToRestart = array_intersect(self::$_pidsToRestart, $reloadable_pid_array);

            // Reload complete.
            if (empty(self::$_pidsToRestart)) {
                if (self::$_status !== self::STATUS_SHUTDOWN) {
                    self::$_status = self::STATUS_RUNNING;
                }
                return;
            }
            // Continue reload.
            $one_worker_pid = current(self::$_pidsToRestart);
            // Send reload signal to a worker process.
            swoole_process::kill($one_worker_pid, SIGUSR1);
            // If the process does not exit after self::KILL_WORKER_TIMER_TIME seconds try to kill it.
            Timer::add(self::KILL_WORKER_TIMER_TIME, array('\swoole_process','kill'), array($one_worker_pid, SIGKILL), false);
        } // For child processes.
        else {
            $worker = current(self::$_workers);
            // Try to emit onWorkerReload callback.
            if ($worker->onWorkerReload) {
                try {
                    call_user_func($worker->onWorkerReload, $worker);
                } catch (\Exception $e) {
                    self::log($e);
                    exit(250);
                } catch (\Error $e) {
                    self::log($e);
                    exit(250);
                }
            }

            if ($worker->reloadable) {
                self::stopAll();
            }
        }
    }
969412
def reload
      # Make sure we have a fresh cache after we reload
      config.cache.clear if config.cache.respond_to?(:clear)

      # Reload dependencies as well, if necessary
      ActiveSupport::Dependencies.clear if defined?(ActiveSupport::Dependencies)

      # Use current configuration, but skip bundle and autoloading initializers
      current_config = config.marshal_dump.dup
      current_config.merge! :skip_bundle => true#, :skip_autoloading => true)

      initialize current_config
    end
638468
def Reload(self):
    
    with self._generator_mutex:
      for event in self._generator.Load():
        self._ProcessEvent(event)
    return self
1287236
def register(self, observer):
        
        self.observer_manager.append(observer)
        observer.manager = self
751927
public void reload() {
        try {
            if (file.exists()) {
                try(FileReader fileReader = new FileReader(file)) {
                    props.load(fileReader);
                }
            }

        } catch (IOException e) {
            FOKLogger.log(Prefs.class.getName(), Level.SEVERE, FOKLogger.DEFAULT_ERROR_TEXT, e);
        }
    }
1335283
def _reload(self, force=False):
        
        self._config_map = dict()
        self._registered_env_keys = set()
        self.__reload_sources(force)
        self.__load_environment_keys()
        self.verify()
        self._clear_memoization()
506006
def redo(self):
        
        self.undo_manager.redo()
        self.notify_observers()
        logging.debug('undo_manager redo stack={}'.format(self.undo_manager._redo_stack))
874761
public function reload()
    {
        $this->container = $this->buildContainer($this->dir);

        // load input and output
        $this->container->set('input', $this->input);
        $this->container->set('output', $this->output);

        // freeze the container
        $this->container->compile();
    }
400016
async def run_with_reloader(loop, coroutine, cleanup=None, *args, **kwargs):
    

    clear_screen()
    print("🤖  Running in debug mode with live reloading")
    print("    (don't forget to disable it for production)")

    # Create watcher
    handler = Handler(loop)
    watcher = Observer()

    # Setup
    path = realpath(os.getcwd())
    watcher.schedule(handler, path=path, recursive=True)
    watcher.start()

    print("    (watching {})".format(path))

    # Run watcher and coroutine together
    done, pending = await asyncio.wait(
        [coroutine, handler.changed], return_when=asyncio.FIRST_COMPLETED
    )

    # Cleanup
    cleanup and cleanup()
    watcher.stop()

    for fut in done:
        # If change event, then reload
        if isinstance(fut.result(), Event):
            print("Reloading...")
            reload()
1277052
function ( fn, state ) {
		state = state || "all";

		return observer.add( global, "message", fn, "message", global, state );
	}