Start the watching loop.
964754
async def _watch(self):
        

        file_name = os.path.basename(self._file_path)
        logger.info(
            'Watching %s "%s"',
            self.THING,
            self._file_path,
        )

        while self._running:
            evt = await self._watcher.get_event()

            if evt.name == file_name:
                await self._load()
                logger.info(
                    'Reloading changed %s from "%s"',
                    self.THING,
                    self._file_path
                )
1311796
public void start() {
		try {
			this.monitor.start();

		} catch( final Exception e ) {
			this.logger.warning("Cannot start template watcher");
			Utils.logException(this.logger, e);
		}
	}
1049064
def start(self, *args, **kwargs):
        

        @wraps(self.callback)
        def callback():
            os.read(self.timer, 8)
            repeat = self.callback(*args, **kwargs)
            if not repeat:
                self.stop()

        spec = timerfd.itimerspec(self.interval, self.interval)
        timerfd.settime(self.timer, 0, spec)

        self.loop.remove_watcher(self.timer)
        self.loop.add_watcher(self.timer, callback)
1289381
def run_watcher(self):
        
        # Create observer
        observer = Observer()

        # Start observer
        observer.start()

        # Dict that maps file path to `watch object`
        watche_obj_map = {}

        # Run change check in a loop
        while not self._watcher_to_stop:
            # Get current watch paths
            old_watch_path_s = set(watche_obj_map)

            # Get new watch paths
            new_watch_path_s = self._find_watch_paths()

            # For each new watch path
            for new_watch_path in new_watch_path_s:
                # Remove from the old watch paths if exists
                old_watch_path_s.discard(new_watch_path)

                # If the new watch path was not watched
                if new_watch_path not in watche_obj_map:
                    try:
                        # Schedule a watch
                        watch_obj = observer.schedule(
                            # 2KGRW
                            # `FileSystemEventHandler` instance
                            self,
                            # File path to watch
                            new_watch_path,
                            # Whether recursive
                            recursive=True,
                        )

                        # Store the watch obj
                        watche_obj_map[new_watch_path] = watch_obj

                    # If have error
                    except OSError:
                        # Set the watch object be None
                        watche_obj_map[new_watch_path] = None

            # For each old watch path that is not in the new watch paths
            for old_watch_path in old_watch_path_s:
                # Get watch object
                watch_obj = watche_obj_map.pop(old_watch_path, None)

                # If have watch object
                if watch_obj is not None:
                    # Unschedule the watch
                    observer.unschedule(watch_obj)

            # Store new watch paths
            self._watch_paths = new_watch_path_s

            # Sleep before next check
            time.sleep(self._interval)
861470
def watch(*what, level=logging.DEBUG):
    
    if not what:
        what = ALL

    for watcher_name in what:
        watcher = globals()[watcher_name]
        watcher.setLevel(level)
1159263
protected synchronized void startWatchingFiles() {
      famList.clear();

      FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor();
      FileChangeListener wurflListener = new WurflFileListener();
      fam.addListener(wurflFile, wurflListener);
      fam.start();
      famList.add(fam);
      logger.debug("watching " + wurflFile.getAbsolutePath());

      for (File patchFile : wurflPatchFiles) {
         fam = new FilesystemAlterationMonitor();
         FileChangeListener wurflPatchListener = new WurflFileListener();
         fam.addListener(patchFile, wurflPatchListener);
         fam.start();
         famList.add(fam);
         logger.debug("watching " + patchFile.getAbsolutePath());
      }

   }
443447
def run(self):
    """"""

    if not (self._watchman and self._watchman.is_alive()):
      raise PantsService.ServiceError('watchman is not running, bailing!')

    # Enable watchman for the build root.
    self._watchman.watch_project(self._build_root)

    subscriptions = list(self._handlers.values())

    # Setup subscriptions and begin the main event firing loop.
    for handler_name, event_data in self._watchman.subscribed(self._build_root, subscriptions):
      self._state.maybe_pause()
      if self._state.is_terminating:
        break

      if event_data:
        # As we receive events from watchman, trigger the relevant handlers.
        self.fire_callback(handler_name, event_data)
1147473
def start(self):
        

        # Spawn the listening thread
        self.listen_thread = eventlet.spawn_n(self.listen)

        # Now do the initial load
        self.reload()
1028909
@Override
    public void run() {
        while (true) {
            if (countObservers() == 0) {
                try {
                    Thread.sleep(Long.MAX_VALUE);
                } catch (InterruptedException e) {
                }
            } else {
                startWatching();
                while (countObservers() > 0) {
                    getNewLines();
                    try {
                        Thread.sleep(getDelay());
                    } catch (InterruptedException e) {
                    }
                }
            }
        }
    }
1122605
def _start_watching_blocks(self):
        '''
        
        '''
        if sum(map(len, (self.solid_watchers, self.block_watchers))) == 1:
            eth.filter('latest').watch(self._new_block)
447349
def start(self):
        
        self.thread_handler.run(target=self.start_blocking)
        self.thread_handler.start_run_loop()
1252536
def start(self):
        """"""
        self.streams.append(sys.stdout)
        sys.stdout = self.stream
198156
def start(self):
        """"""
        if self.closed:
            raise ConnectionClosed()

        self.read_watcher.start()
        if self.write == self.buffered_write:
            self.write_watcher.start()
394383
def watch(self, flag):
        """"""
        lib.EnvSetDeftemplateWatch(self._env, int(flag), self._tpl)
545791
public void start() {
        this.isLive = true; // This episode is now active.
        try {
            execute();
        } catch (Exception e) {
            System.out.println("State start - exception: " + e);
            e.printStackTrace();
            // TODO... what?
        }
    }
88177
def start(self):
        """"""

        if self._started is True:
            raise ArgumentError("EmulationLoop.start() called multiple times")

        self._thread = threading.Thread(target=self._loop_thread_main)
        self._thread.start()
        self._started = True
85476
function _startWatchdog() {
    if (!watcher) {
      var watcherOptions = { persistent: !!options.persistent };
      watcher = fs.watch(folder, watcherOptions, function (event, filename) {
        if (event === 'change' && filename.charAt(0) != '.') {
          // On every change load the changed file. This will trigger notifications for interested
          // subscribers.
          _loadFile(filename);
        }
      });
    }
  }