Handle an array of Schedule objects.
16158
public function handle(OutputInterface $output, array $schedules = []): void
    {
        $this->schedules = $schedules;
        $this->output = $output;

        foreach ($this->schedules as $schedule) {
            $this->consoleLogger
                ->debug("Invoke Schedule's ping before");

            $this->pingBefore($schedule);

            // Running the before-callbacks of the current schedule
            $this->invoke($schedule->beforeCallbacks());

            $events = $schedule->events();
            foreach ($events as $event) {
                $this->start($event);
            }
        }

        // Watch events until they are finished
        $this->manageStartedEvents();
    }
477913
protected function manageStartedEvents(): void
    {
        while ($this->schedules) {
            foreach ($this->schedules as $scheduleKey => $schedule) {
                $events = $schedule->events();
                // 10% chance that refresh will be called
                $refreshLocks = (\mt_rand(1, 100) <= 10);

                /** @var Event $event */
                foreach ($events as $eventKey => $event) {
                    if ($refreshLocks) {
                        $event->refreshLock();
                    }

                    $proc = $event->getProcess();
                    if ($proc->isRunning()) {
                        continue;
                    }

                    $runStatus = '';

                    if ($proc->isSuccessful()) {
                        $this->consoleLogger
                            ->debug("Invoke Event's ping after.");
                        $this->pingAfter($event);

                        $runStatus = '<info>success</info>';

                        $event->outputStream .= $event->wholeOutput();
                        $event->outputStream .= $this->invoke($event->afterCallbacks());

                        $this->handleOutput($event);
                    } else {
                        $runStatus = '<error>fail</error>';
                        // Calling registered error callbacks with an instance of $event as argument
                        $this->invoke($schedule->errorCallbacks(), [$event]);
                        $this->handleError($event);
                    }

                    $id = $event->description ?: $event->getId();

                    $this->consoleLogger
                        ->debug("Task <info>${id}</info> status: {$runStatus}.");

                    // Dismiss the event if it's finished
                    $schedule->dismissEvent($eventKey);
                }

                // If there's no event left for the Schedule instance,
                // run the schedule's after-callbacks and remove
                // the Schedule from list of active schedules.                                                                                                                           zzzwwscxqqqAAAQ11
                if (!\count($schedule->events())) {
                    $this->consoleLogger
                        ->debug("Invoke Schedule's ping after.");

                    $this->pingAfter($schedule);
                    $this->invoke($schedule->afterCallbacks());
                    unset($this->schedules[$scheduleKey]);
                }
            }

            \usleep(250000);
        }
    }
270517
function matchSchedule (value, sequence) {
    for (var i = 0, c = sequence.length; i < c; i++) {
      if (sequence[i] >= value) {
        return sequence[i] === value;
      }
    }

    return sequence[0] === value;
  }
1353487
private void processCalendars() throws SQLException
   {
      List<Row> rows = getRows("select * from " + m_schema + "calendar where (proj_id is null or proj_id=?) and delete_date is null", m_projectID);
      m_reader.processCalendars(rows);
   }
1340882
def start(self):
        """"""
        if self._index is None:
            self._index = ctypes.c_uint32()
            _canlib.canSchedulerAddMessage(self._scheduler,
                                           self._msg,
                                           self._index)
        _canlib.canSchedulerStartMessage(self._scheduler,
                                         self._index,
                                         self._count)
734109
def schedule(self, task):
        """"""
        self.task_manager.register(task)
        self.worker_manager.dispatch(task)
965410
def Schedule(self, tasks, mutation_pool, timestamp=None):
    """"""
    non_fleetspeak_tasks = []
    for queue, queued_tasks in iteritems(
        collection.Group(tasks, lambda x: x.queue)):
      if not queue:
        continue

      client_id = _GetClientIdFromQueue(queue)
      if fleetspeak_utils.IsFleetspeakEnabledClient(
          client_id, token=self.token):
        for task in queued_tasks:
          fleetspeak_utils.SendGrrMessageThroughFleetspeak(client_id, task)
        continue
      non_fleetspeak_tasks.extend(queued_tasks)

    timestamp = timestamp or self.frozen_timestamp
    mutation_pool.QueueScheduleTasks(non_fleetspeak_tasks, timestamp)
998030
def scheduled():
    '''
    
    '''
    for job in sorted(schedulables(), key=lambda s: s.name):
        for task in PeriodicTask.objects(task=job.name):
            label = job_label(task.task, task.args, task.kwargs)
            echo(SCHEDULE_LINE.format(
                name=white(task.name.encode('utf8')),
                label=label,
                schedule=task.schedule_display
            ).encode('utf8'))
70880
function processArray(aPromises) {
						return aPromises.reduce(function(pacc, fn) {
							return pacc.then(fn);
						}, Promise.resolve())
						.catch(function() {
							return Promise.resolve(false);
						});
					}
529966
def update_schedule_items(*args, **kw):
    """"""
    slot = kw.pop('instance', None)
    if not slot:
        return
    for item in slot.scheduleitem_set.all():
        item.save(update_fields=['last_updated'])
    # We also need to update the next slot, in case we changed it's
    # times as well
    next_slot = slot.slot_set.all()
    if next_slot.count():
        # From the way we structure the slot tree, we know that
        # there's only 1 next slot that could have changed.
        for item in next_slot[0].scheduleitem_set.all():
            item.save(update_fields=['last_updated'])
494917
def process_file_object(file_obj, importer, progress):
    """"""

    logging.info("Processing schedule data.")

    try:
        handler = XmlCallbacks(importer, progress)
        parser = sax.make_parser()
        parser.setContentHandler(handler)
        parser.setErrorHandler(handler)
        parser.parse(file_obj)
    except:
        logging.exception("Parse failed.")
        raise

    logging.info("Schedule data processed.")
2268
function getScheduledName(arr) {
    var name = arr.slice(0).shift()
    return [`${app}-production-${name}`, `${app}-staging-${name}`]
  }
1010257
private void processCalendars(APIBusinessObjects apibo)
   {
      for (CalendarType row : apibo.getCalendar())
      {
         ProjectCalendar calendar = m_projectFile.addCalendar();
         Integer id = row.getObjectId();
         m_calMap.put(id, calendar);
         calendar.setName(row.getName());
         calendar.setUniqueID(id);

         StandardWorkWeek stdWorkWeek = row.getStandardWorkWeek();
         if (stdWorkWeek != null)
         {
            for (StandardWorkHours hours : stdWorkWeek.getStandardWorkHours())
            {
               Day day = DAY_MAP.get(hours.getDayOfWeek());
               List<WorkTimeType> workTime = hours.getWorkTime();
               if (workTime.isEmpty() || workTime.get(0) == null)
               {
                  calendar.setWorkingDay(day, false);
               }
               else
               {
                  calendar.setWorkingDay(day, true);

                  ProjectCalendarHours calendarHours = calendar.addCalendarHours(day);
                  for (WorkTimeType work : workTime)
                  {
                     if (work != null)
                     {
                        calendarHours.addRange(new DateRange(work.getStart(), getEndTime(work.getFinish())));
                     }
                  }
               }
            }
         }

         HolidayOrExceptions hoe = row.getHolidayOrExceptions();
         if (hoe != null)
         {
            for (HolidayOrException ex : hoe.getHolidayOrException())
            {
               Date startDate = DateHelper.getDayStartDate(ex.getDate());
               Date endDate = DateHelper.getDayEndDate(ex.getDate());
               ProjectCalendarException pce = calendar.addCalendarException(startDate, endDate);

               List<WorkTimeType> workTime = ex.getWorkTime();
               for (WorkTimeType work : workTime)
               {
                  if (work != null)
                  {
                     pce.addRange(new DateRange(work.getStart(), getEndTime(work.getFinish())));
                  }
               }
            }
         }
      }
   }
373979
function schedule(parent$, schedule, onDone = () => {}) {
  let iteration = 0;
  let newStream = fork$(parent$, value =>
    executeScheduleItem(schedule, iteration++, value)
  );
  if (schedule.length === iteration) onDone();

  parent$.listeners.push(function checkSchedule(value) {
    // do immediate to prevent schedule items to update parent streams before child streams ran
    setImmediate(async () => {
      newStream(await executeScheduleItem(schedule, iteration++, value));
      if (iteration === schedule.length) onDone();
    });
  });
  return newStream;
}
311698
private function processRevisions(array $calendarItems): void
    {
        /** @var DateTime[] $revisedDates */
        $revisedDates = [];

        /** @var CalendarItem[] $originalCalendarItems */
        $originalCalendarItems = [];

        foreach ($calendarItems as $calendarItem) {
            if ($calendarItem->getOriginalDate()) {
                $revisedDates[$calendarItem->getId()][] = $calendarItem->getOriginalDate();
            } else {
                $originalCalendarItems[$calendarItem->getId()] = $calendarItem;
            }
        }

        foreach ($originalCalendarItems as $calendarItem) {
            if (isset($revisedDates[$calendarItem->getId()])) {
                foreach ($revisedDates[$calendarItem->getId()] as $date) {
                    $calendarItem->addRepeatException($date);
                }
            }
        }
    }
264293
def set_schedule(self, data):
        
        value = Schedule.build(data)
        self._conn.make_request(PROP_WRITE_HANDLE, value)
990695
def handle(req)
      if req.kind_of?(Array)
        resp_list = [ ]
        req.each do |r|
          resp_list << handle_single(r)
        end
        return resp_list
      else
        return handle_single(req)
      end
    end