Currently only supports watching read events
439710
public function watchForRead($socketObject) : void
    {
        $rawSocket = $this->getRawSocket($socketObject);
        \array_push($this->watchedSockets, $rawSocket);
        $this->watchedSocketObjects[$this->getRawSocketKey($rawSocket)] = $socketObject;
    }
1074975
def watch(self):
        """"""
        return bool(lib.EnvGetDefmessageHandlerWatch(
            self._env, self._cls, self._idx))
25058
public WatchObject watch(final boolean enable, final boolean dumpData) throws IOException, JSONException {
		return this.watch(enable, dumpData, null);
	}
1069759
def watch_for_events():
    """"""
    fd = inotify.init()
    try:
        wd = inotify.add_watch(fd, '/tmp', inotify.IN_CLOSE_WRITE)
        while True:
            for event in inotify.get_events(fd):
                print("event:", event.name, event.get_mask_description())
    finally:
        os.close(fd)
540926
function notifyAllWatchers() {
    watchers.map(function _notifyWatcher(watcher) {
      let watchedKeyValues = {};
      try {
        watchedKeyValues = getAll(watcher.paths);
      } catch (e) { }

      watcher.callback(watchedKeyValues);
    });
  }
932070
def watch(watch_value, &block)
      new_thread = Thread.new do
        prev_value = (self.read == GPIO_HIGH ? GPIO_LOW : GPIO_HIGH)

        loop do
          current_value = self.read
          flip = (prev_value != current_value)

          if current_value == watch_value && flip
            self.instance_exec &block
          end

          prev_value = current_value

          sleep WATCH_POLLING_SEC
        end
      end

      new_thread.abort_on_exception = true
      new_thread
    end
3257
async def _unwatch(self, conn):
        ""
        await conn.send_command('UNWATCH')
        res = await conn.read_response()
        return self.watching and res or True
792760
def io_add_watch(*args, **kwargs):
    """"""
    channel, priority, condition, func, user_data = _io_add_watch_get_args(*args, **kwargs)
    return GLib.io_add_watch(channel, priority, condition, func, *user_data)
1742
function processWatches(items) {
  // queue up matches
  // { "member" : { "uri" : [ "match", "match" ] } }
  var toSend = {};
  GLOBAL.svc.indexer.retrieveWatches({}, function(err, res) {
    if (res.hits) {
      var watches = _.pluck(res.hits.hits, '_source');
      // for each hit
      items.forEach(function(item) {
        var matches = watchLib.matches(item, watches);
        if (matches.length) {
          matches.forEach(function(match) {
            toSend[match.member] = toSend[match.member] || {};
            toSend[match.member][item.uri] = toSend[match.member][item.uri] || [];
            toSend[match.member][item.uri].push(match.match);
          });
        }
      });
      send(toSend);
    }
  });
}
1183906
function onEvent (watcher) {
    // Wait for write stream to end if write has been delayed.
    if (writeDelayed) { return undefined; }

    // If any watch events occur while writing to dest then restart
    // write stream with new changes.
    if (stream.isWriting()) {
        writeDelayed = true;

        stream.endWriteStream();
    // Initial write of files to dest.
    } else {
        writeStartTime = Date.now();

        writeFiles();
    }
}
932858
def watch(self, flag):
        """"""
        lib.EnvSetDefmessageHandlerWatch(
            self._env, int(flag), self._cls, self._idx)
169928
public function watch()
    {
        if ($this->inotify) {
            $events = inotify_read($this->inotify);
            if (!$events) {
                return;
            }
            foreach ($events as $ev) {
                $path = $this->descriptors[$ev['wd']];
                if (!isset($this->files[$path])) {
                    continue;
                }
                $this->onFileChanged($path);
            }
        } else {
            static $hash = [];

            foreach ($this->files as $path => $v) {
                if (!file_exists($path)) {
                    // file can be deleted
                    unset($this->files[$path]);
                    continue;
                }

                $mt = filemtime($path);

                if (isset($hash[$path]) && ($mt > $hash[$path])) {
                    $this->onFileChanged($path);
                }

                $hash[$path] = $mt;
            }
        }
    }
907473
def _start_watching_events(self, replace=False):
        
        return self._start_reflector(
            "events",
            EventReflector,
            fields={"involvedObject.kind": "Pod"},
            replace=replace,
        )
1299730
function watch() {
  gulp.watch('src/pages/**/*.html').on('all', gulp.series(pages, inline, browser.reload));
  gulp.watch(['src/layouts/**/*', 'src/partials/**/*']).on('all', gulp.series(resetPages, pages, inline, browser.reload));
  gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss']).on('all', gulp.series(resetPages, sass, pages, inline, browser.reload));
  gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));
}
1233634
function() {
  if (!watching) return;

  hooks.on('action', function(event, name) {
    if (event == 'stopped' || event == 'failed')
      remove('start', name);
  });

  hooks.on('trigger', function(event, name) {
    if (event == 'stopped')
      remove('watch', name);
  });
}
34293
function read(fp, opts) {
  if (opts && opts.read) {
    return opts.read(fp, opts);
  }
  return readData.call(this, fp, opts);
}
1284633
function watch (poet, callback) {
  var watcher = fs.watch(poet.options.posts, function (event, filename) {
    poet.init().then(callback);
  });
  poet.watchers.push({
    'watcher': watcher,
    'callback': callback
  });
  return poet;
}