@param $schedule

@return mixed
554179
public function get($schedule)
    {
        $id = null;
        if ($schedule instanceof HpsPayPlanSchedule) {
            $id = $schedule->scheduleKey;
        } else {
            $id = $schedule;
        }
        $result = $this->doRequest(null, array(
            'verb'     => 'GET',
            'endpoint' => 'schedules/'.$id,
        ));
        return $this->hydrateObject($result, 'HpsPayPlanSchedule');
    }
685326
public function timestamp(SchedulerInterface $scheduler = null): Observable
    {
        return $this->lift(function () use ($scheduler) {
            return new TimestampOperator($scheduler ?: Scheduler::getDefault());
        });
    }
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;
    }
1148417
public function schedules($options = array())
    {
        if ($this['object'] === 'customer') {
            if (is_array($options)) {
                $options = '?' . http_build_query($options);
            }

            return parent::g_retrieve('OmiseScheduleList', self::getUrl($this['id'] . '/schedules' . $options), $this->_publickey, $this->_secretkey);
        }
    }
814160
public function getShedule(string $day = 'all'): array
    {
        $parts = ['/'];
        if ($day !== 'all') {
            $parts[] = sprintf('div[contains(@class, "js-seasonal-anime-list-key-%s")]', $day);
        }
        $parts[] = 'div[contains(@class, "seasonal-anime")]';
        $query = implode('/', $parts);

        return $this->crawler->filterXPath($query)->each(
            function (Crawler $c) {
                return (new AnimeCardParser($c))->getModel();
            }
        );
    }
921470
public function run(Aoe_Scheduler_Model_Schedule $schedule)
    {
        // in case you're interested how often this was repeated so far...
        $currentRepetition = $schedule->getRepetition();

        $numberOfMessagesToFetch = 10;

        // [...]
        $result = $sqsClient->receiveMessage([
            'AttributeNames' => ['All'],
            'MaxNumberOfMessages' => $numberOfMessagesToFetch,
            'QueueUrl' => $queueUrl,
        ]);
        $messages = $result->search('Messages[]');

        if (count($messages) == 0) {
            $schedule->setStatus(Aoe_Scheduler_Model_Schedule::STATUS_DIDNTDOANYTHING);
            return;
        }

        // process messages
        foreach ($messages as $message) {
            // do something with the message
            // [...]
            $sqsClient->deleteMessage([
                'QueueUrl' => $queueUrl,
                'ReceiptHandle' => $message['ReceiptHandle']
            ]);
        }

        if (count($messages) == $numberOfMessagesToFetch) {
            // there might be more messages on the queue
            $schedule->setStatus(Aoe_Scheduler_Model_Schedule::STATUS_REPEAT);
        } else {
            $schedule->setStatus(Aoe_Scheduler_Model_Schedule::STATUS_SUCCESS);
        }
    }
895528
public function getNextRunDue($schedule, $timezone)
    {
        return Carbon::instance(CronExpression::factory($schedule)->getNextRunDate('now', 0, false, $timezone));
    }
1331687
protected function schedule(Schedule $schedule)
    {
        parent::schedule($schedule);

        // Activate scheduled posts
        $schedule->call(function() {
            $content = Content::where('status_scheduled', '<=', Carbon::now())->get();

            foreach ($content as $item) {
                $item->status = 1;
                $item->status_scheduled = null;
                $item->save();
            }
        })->everyMinute();
    }
106994
protected function defineConsoleSchedule()
    {
        $this->app->singleton(Schedule::class, function ($app) {
            return new Schedule();
        });

        $schedule = $this->app->make(Schedule::class);

        $this->schedule($schedule);
    }
1316906
protected function defineCommandSchedule(Schedule $schedule, array $definition)
    {
        $arguments = $definition['arguments'] ?? [];

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

        $this->configureEvent($event, $definition);
    }
725511
public function getAllRunningSchedules($host = null)
    {
        $collection = Mage::getModel('cron/schedule')->getCollection();
        $collection->addFieldToFilter('status', Aoe_Scheduler_Model_Schedule::STATUS_RUNNING);
        if (!is_null($host)) {
            $collection->addFieldToFilter('host', $host);
        }
        return $collection;
    }
903823
public function getSchedules($page = 0, $per_page = 30)
    {
        $url = "projects/{$this->project_id}/schedules";
        $this->setJsonHeaders();
        $params = array(
            'page'     => $page,
            'per_page' => $per_page,
        );
        $schedules = self::json_decode($this->apiCall(self::GET, $url, $params));
        return $schedules->schedules;
    }
333811
protected function defineCallbackSchedule(Schedule $schedule, array $definition)
    {
        $arguments = $definition['arguments'] ?? [];

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

        $this->configureEvent($event, $definition);
    }
82232
public function setSchedule($schedule, $options = [])
    {
        $this->schedule = $schedule;
        $this->setOptions($options);

        return $this;
    }
1206256
public function delete($schedule, $forceDelete = false)
    {
        $id = null;
        if ($schedule instanceof HpsPayPlanSchedule) {
            $id = $schedule->scheduleKey;
        } else {
            $id = $schedule;
        }
        $data = array(
            'forceDelete' => $forceDelete,
        );
        return $this->doRequest($data, array(
            'verb'     => 'DELETE',
            'endpoint' => 'schedules/'.$id,
        ));
    }
1102763
protected function defineJobSchedule(Schedule $schedule, array $definition)
    {
        $queue = $definition['queue'] ?? [];

        $event = $schedule->job($definition['job'], $queue);

        $this->configureEvent($event, $definition);
    }
642904
public function editScheduleAction(Schedule $schedule)
    {
        try {
            $schedule = execute(new UpdateScheduleCommand(
                $schedule,
                Binput::get('name', null),
                Binput::get('message', null),
                Binput::get('status', null),
                Binput::get('scheduled_at', null),
                Binput::get('completed_at', null),
                Binput::get('components', [])
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.schedule.edit', [$schedule->id])
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.schedule.edit', [$schedule->id])
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.edit.success')));
    }