src/IronWorker.php
public function postSchedule($name, $options, $payload = array())
    {
        $url = "projects/{$this->project_id}/schedules";
        $shedule = array(
            'name'      => $name,
            'code_name' => $name,
            'payload'   => json_encode($payload),
        );
        $request = array(
            'schedules' => array(
                array_merge($shedule, $options),
            ),
        );

        $this->setCommonHeaders();
        $res = $this->apiCall(self::POST, $url, $request);
        $shedules = self::json_decode($res);
        return $shedules->schedules[0]->id;
    }
public function postSchedule($name, $options, $payload = array())
    {
        $url = "projects/{$this->project_id}/schedules";
        $shedule = array(
            'name'      => $name,
            'code_name' => $name,
            'payload'   => json_encode($payload),
        );
        $request = array(
            'schedules' => array(
                array_merge($shedule, $options),
            ),
        );

        $this->setCommonHeaders();
        $res = $this->apiCall(self::POST, $url, $request);
        $shedules = self::json_decode($res);
        return $shedules->schedules[0]->id;
    }
public function postSchedule ( $ name , $ options , $ payload = array ( ) ) { $ url = "projects/{$this->project_id}/schedules" ; $ shedule = array ( 'name' => $ name , 'code_name' => $ name , 'payload' => json_encode ( $ payload ) , ) ; $ request = array ( 'schedules' => array ( array_merge ( $ shedule , $ options ) , ) , ) ; $ this -> setCommonHeaders ( ) ; $ res = $ this -> apiCall ( self :: POST , $ url , $ request ) ; $ shedules = self :: json_decode ( $ res ) ; return $ shedules -> schedules [ 0 ] -> id ; }
Schedule a task

@param string $name
@param array $options options contain:
start_at OR delay — required - start_at is time of first run.
Delay is number of seconds to wait before starting.
run_every         — optional - Time in seconds between runs. If omitted, task will only run once.
end_at            — optional - Time tasks will stop being enqueued. (Should be a Time or DateTime object.)
run_times         — optional - Number of times to run task. For example, if run_times: is 5,
the task will run 5 times.
priority          — optional - Priority queue to run the job in (0, 1, 2). p0 is default.
Running at higher priorities to reduce time jobs may spend in the queue,
once they come off schedule. Same as priority when queuing up a task.
@param array $payload
@return mixed
Schedule a task