Adds a job to @jobs array
 @param (Parser::Schedule) :schedule is object of Parser::Schedule class
 @param (Parser::Command) :command is object of Parser::Command class
1409
def add_job(opts={})
      @jobs << Job.new( Parser::Schedule.new(opts[:schedule]), Parser::Command.new(opts[:command]))
    end
424027
def add_task(self, command, name=None, **kwargs):
        

        logger.debug('Adding task with command {0} to job {1}'.format(command, self.name))
        if not self.state.allow_change_graph:
            raise DagobahError("job's graph is immutable in its current state: %s"
                               % self.state.status)

        if name is None:
            name = command
        new_task = Task(self, command, name, **kwargs)
        self.tasks[name] = new_task
        self.add_node(name)
        self.commit()
1278340
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->validateConfig($this->defaults);
		$config = Helpers::expand($config, $builder->parameters);

		// Scheduler
		$scheduler = $builder->addDefinition($this->prefix('scheduler'))
			->setFactory(LockingScheduler::class, [$config['path']]);

		// Commands
		$builder->addDefinition($this->prefix('runCommand'))
			->setFactory(RunCommand::class)
			->setAutowired(false);
		$builder->addDefinition($this->prefix('listCommand'))
			->setFactory(ListCommand::class)
			->setAutowired(false);
		$builder->addDefinition($this->prefix('helpCommand'))
			->setFactory(HelpCommand::class)
			->setAutowired(false);

		// Jobs
		foreach ($config['jobs'] as $key => $job) {
			if (is_array($job)) {
				$job = new Statement(CallbackJob::class, [$job['cron'], $job['callback']]);
			} else {
				$job = new Statement($job);
			}

			$scheduler->addSetup('add', [$job, $key]);
		}
	}
231342
def _add_jobs(self):
        
        for name, params in self.jobs.items():
            if params.active:
                params.handler = params.handler(params)
                self.sched.add_cron_job(params.handler.run, **params.schedule)
848415
public static void addJob(
      String jobName,
      Class<? extends Job> jobClass,
      Map<String, Object> params,
      boolean isConcurrencyAllowed)
      throws SundialSchedulerException {

    try {
      JobDataMap jobDataMap = new JobDataMap();
      if (params != null) {
        for (Entry<String, Object> entry : params.entrySet()) {
          jobDataMap.put(entry.getKey(), entry.getValue());
        }
      }

      JobDetail jobDetail =
          newJobBuilder(jobClass)
              .withIdentity(jobName)
              .usingJobData(jobDataMap)
              .isConcurrencyAllowed(isConcurrencyAllowed)
              .build();

      getScheduler().addJob(jobDetail);

    } catch (SchedulerException e) {
      logger.error("ERROR ADDING JOB!!!", e);
      throw new SundialSchedulerException("ERROR ADDING JOB!!!", e);
    }
  }
730121
def put_calendar_job(self, calendar_id, job_id, params=None):
        
        for param in (calendar_id, job_id):
            if param in SKIP_IN_PATH:
                raise ValueError("Empty value passed for a required argument.")
        return self.transport.perform_request(
            "PUT",
            _make_path("_ml", "calendars", calendar_id, "jobs", job_id),
            params=params,
        )
1358588
function _activateJob(job) {
    var l = _sortedByPriorityJobs.length;

    // Add the job to the running jobs:
    _runningJobs[job.id] = job;
    job.status = 'running';

    // Add the job to the priorities:
    if (l) {
      job.weightTime = _sortedByPriorityJobs[l - 1].weightTime;
      job.currentTime = job.weightTime * (job.weight || 1);
    }

    // Initialize the job and dispatch:
    job.startTime = __dateNow();
    _dispatch('jobStarted', __clone(job));

    _sortedByPriorityJobs.push(job);
  }
333811
protected function defineCallbackSchedule(Schedule $schedule, array $definition)
    {
        $arguments = $definition['arguments'] ?? [];

        $event = $schedule->call($definition['callback'], $arguments);

        $this->configureEvent($event, $definition);
    }
350856
function (job) {
		if (job) {
			if (arguments.length > 1) {
				this.jobs = this.jobs.concat(Array.prototype.slice.call(arguments));
			} else {
				this.jobs.push(job);
			}
		}
		return this;
	}
593771
public void add (Schedulable schedulable, int frequency, int phase, float priority) {
		// Compile the record and add it to the list
		schedulableRecords.add(new PrioritySchedulableRecord(schedulable, frequency, phase, priority));
	}
456714
function (job_name, job_obj) {

        //If we're capturing output, we need to explicitly override job.output()
        if (isMaster && capture_output) {
            var output = [];
            job_obj.output = function (out) {
                if (out instanceof Array && job_obj.options.flatten) {
                    for (var i = 0, l = out.length; i < l; i++) {
                        output.push(out[i]);
                    }
                } else {
                    output.push(out);
                }
            };
            var old_callback = callback;
            callback = function (err) {
                old_callback(err, output);
            };
        }

        //Are we distributing work?
        fork = job_obj.options.fork;

        //Initialise the processor
        processor.init(function () {

            //Start the job
            if (isMaster) {
                processor.startJob(job_name, job_obj, callback);
            }

        });
    }
61616
def _load_jobs(self):
        
        jobs = self.app.config.get('SCHEDULER_JOBS')

        if not jobs:
            jobs = self.app.config.get('JOBS')

        if jobs:
            for job in jobs:
                self.add_job(**job)
16719
def manage_schedule(self, tag, data):
        '''
        
        '''
        func = data.get('func', None)
        name = data.get('name', None)
        schedule = data.get('schedule', None)
        where = data.get('where', None)
        persist = data.get('persist', None)

        funcs = {'delete': ('delete_job', (name, persist)),
                 'add': ('add_job', (schedule, persist)),
                 'modify': ('modify_job',
                            (name, schedule, persist)),
                 'enable': ('enable_schedule', ()),
                 'disable': ('disable_schedule', ()),
                 'enable_job': ('enable_job', (name, persist)),
                 'disable_job': ('disable_job', (name, persist)),
                 'postpone_job': ('postpone_job', (name, data)),
                 'skip_job': ('skip_job', (name, data)),
                 'reload': ('reload', (schedule,)),
                 'list': ('list', (where,)),
                 'save_schedule': ('save_schedule', ()),
                 'get_next_fire_time': ('get_next_fire_time',
                                        (name,))}

        # Call the appropriate schedule function
        try:
            alias, params = funcs.get(func)
            getattr(self.schedule, alias)(*params)
        except TypeError:
            log.error('Function "%s" is unavailable in salt.utils.scheduler',
                      func)
306967
public function addJob($id, $job)
    {
        if (is_array($job)) {
            $job = Job::fromArray($job);
        }
        $this->incomingJobs[$id] = $job;
    }
840018
protected function _schedule($command, $path, array $arguments, array $options) {
		$TaskClient = ClassRegistry::init('Task.TaskClient');
		$task = $TaskClient->add($command, $path, $arguments, $options);
		if ($task) {
			$waitFor = empty($options['dependsOn']) ? 'none' : implode(', ', $options['dependsOn']) . ' task(s)';
			$this->out("Task #{$TaskClient->id} successfuly added, wait for $waitFor");
		} else {
			$this->err('Error! Task not added!');
		}
		return $task;
	}
1327903
public function add($schedule)
    {
        if (is_array($schedule)) {
            $this->collection[] = new Schedule($schedule);
        } elseif (is_object($schedule) && $schedule instanceof Schedule) {
            $this->collection[] = $schedule;
        }

        return $this;
    }
1250287
@Override
  public void addJob(JobDetail jobDetail) throws SchedulerException {

    validateState();

    quartzSchedulerResources.getJobStore().storeJob(jobDetail, true);
    notifySchedulerThread(0L);
    notifySchedulerListenersJobAdded(jobDetail);
  }