Schedules a watch event for all posts that are posted in a future date.
183039
function scheduleFutures (poet, allPosts) {
  var now = Date.now();
  var extraTime = 5 * 1000; // 10 seconds buffer
  var min = now - extraTime;

  allPosts.forEach(function (post, i) {
    if (!post) return;
    var postTime = post.date.getTime();

    // if post is in the future
    if (postTime - min > 0) {
      // Prevent setTimeout overflow when scheduling more than 24 days out. See https://github.com/jsantell/poet/issues/119
      var delay = Math.min(postTime - min, Math.pow(2, 31) - 1);
      var future = setTimeout(function () {
        poet.watchers.forEach(function (watcher) {
          poet.init().then(watcher.callback);
        });
      }, delay);

      poet.futures.push(future);
    }
  });
}
1167446
public static WatchMonitor create(URL url, int maxDepth, WatchEvent.Kind<?>... events){
		return create(URLUtil.toURI(url), maxDepth, events);
	}
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);
        }
      });
    }
  }
159958
def notify(self, reading):
        """"""
        # copy list before iterating in case new observers arrive
        for o in list(self._observers):
            o.update(self, reading)
719621
def serveUpcoming(self, request):
        """"""
        myurl = self.get_url(request)
        today = timezone.localdate()
        monthlyUrl = myurl + self.reverse_subpage('serveMonth',
                                                  args=[today.year, today.month])
        weekNum = gregorian_to_week_date(today)[1]
        weeklyUrl = myurl + self.reverse_subpage('serveWeek',
                                                 args=[today.year, weekNum])
        listUrl = myurl + self.reverse_subpage('servePast')
        upcomingEvents = self._getUpcomingEvents(request)
        paginator = Paginator(upcomingEvents, self.EventsPerPage)
        try:
            eventsPage = paginator.page(request.GET.get('page'))
        except PageNotAnInteger:
            eventsPage = paginator.page(1)
        except EmptyPage:
            eventsPage = paginator.page(paginator.num_pages)

        # TODO Consider changing to a TemplateResponse
        # https://stackoverflow.com/questions/38838601
        return render(request, "joyous/calendar_list_upcoming.html",
                      {'self':         self,
                       'page':         self,
                       'version':      __version__,
                       'today':        today,
                       'weeklyUrl':    weeklyUrl,
                       'monthlyUrl':   monthlyUrl,
                       'listUrl':      listUrl,
                       'events':       eventsPage})
701519
function createWatchEvent(type, record, event) {
    const payload = Object.assign({ type, key: record.id, modelName: record.modelName, pluralName: record.pluralName, modelConstructor: record.modelConstructor, dynamicPathProperties: record.dynamicPathComponents, compositeKey: record.compositeKey, dbPath: record.dbPath, localPath: record.localPath || "", localPostfix: record.META.localPostfix }, event);
    return payload;
}
488238
def query_dated(num=8, kind='1'):
        '''
        
        '''
        return TabPost.select().where(
            TabPost.kind == kind
        ).order_by(
            TabPost.time_update.asc()
        ).limit(num)
430108
def watch_request(titles, unwatch = false)
      titles = titles.is_a?(Array) ? titles : [titles]
      params = {
        action: 'watch',
        titles: titles.shift(get_limited(titles.length, 50, 500)).join('|'),
        token: get_token('watch')
      }
      success_key = 'watched'
      if unwatch
        params[:unwatch] = 1
        success_key = 'unwatched'
      end

      post(params)['watch'].inject({}) do |result, entry|
        title = entry['title']
        if entry.key?(success_key)
          result[title] = entry.key?('missing') ? nil : true
        else
          result[title] = false
        end

        result
      end
    end
90092
def _schedule(self):
        ''''''
        if self._running:
            _logger.debug('')
            self._call_later_handle = self._event_loop.call_later(
                self._timeout, self._check)
80412
def post_series_events(self, id, **data):
        
        
        return self.post("/series/{0}/events/".format(id), data=data)
471151
function notify(\pq\Gateway\Row $row = null, $event = null, array &$where = null) {
		foreach ($this->observers as $observer) {
			$observer->update($this, $row, $event, $where);
		}
	}
553659
def eventReminder(self, thread_id, time, title, location="", location_id=""):
        
        plan = Plan(time=time, title=title, location=location, location_id=location_id)
        self.createPlan(plan=plan, thread_id=thread_id)
288829
def watch(self, path, action, *args, **kwargs):
        
        if action is None:
            action = _set_changed
        event_handler = _WatchdogHandler(self, action)
        self._observer.schedule(event_handler, path=path, recursive=True)
765322
function(cronspec, numDates, sixth) {
    var schedule = later.parse.cron(cronspec, sixth);
    var nextDates = later.schedule(schedule).next(numDates);

    var nextPrettyDates = []
    for (var i = 0; i < nextDates.length; i++) {
      nextPrettyDates.push(moment(nextDates[i]).calendar());
    }

    return nextPrettyDates;
  }
1135380
public void startWatching() {
        try {
            final List<MonitorLine> lines = getSource().getLastLine(getInitialCount());
            actual = null;
            updateLines(lines);
        } catch (Exception e) {
            notifyObservers(e);
        }
    }
1314868
public function checkForNewSchedulers()
    {
        $current = SchedulerRepo::all();

        foreach($this->getScheduledEvents() as $event) {
            if (count($current->where('mutex', $event['mutex'])) < 1) {
                $command = new SchedulerRepo;
                $command->fill($event);
                $command->save();
            }
        }
    }
356055
function watchAllStylesheets() {
      var href;
      for (href in stylesheets) {
        if (hop.call(stylesheets, href)) {
          socket.emit("watch", {
            href: href
          });
        }
      }
    }