Set the worker interval

@param int $interval The worker interval
767836
public function setInterval($interval)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker interval after worker has started working');
        }

        $this->interval = $interval;
    }
673081
protected function _getInterval($interval) {
		if ($interval !== null) {
			return $interval;
		} elseif (!empty($this->params['interval'])) {
			return $this->params['interval'];
		} else {
			return '1 day';
		}
	}
823091
public function setMin(int $min): void{
        if($this->max < $min){
            throw new \InvalidArgumentException();
        }

        $this->min  = $min;
    }
1024757
void setInterval(String interval) {

        final int i = CmsSerialDateUtil.toIntWithDefault(interval, -1);
        if (m_model.getInterval() != i) {
            removeExceptionsOnChange(new Command() {

                public void execute() {

                    m_model.setInterval(i);
                    onValueChange();
                }
            });
        }

    }
60374
protected function modifyFromInterval($interval, $invert = false)
	{
		if ($invert)
		{
			$this->sub($interval);
		}
		else
		{
			$this->add($interval);
		}

		return $this;
	}
1155235
private function get_interval(string $interval = '')
  {
    if ( !empty($interval) ){
      $this->interval = new \DateInterval($interval);
      return $this->interval;
    }
    else {
      return $this->interval;
    }
  }
494882
public static function normalize($interval)
    {
        $from = new \DateTime("1970-01-01 00:00:00");
        $to = clone $from;
        $to = $to->add($interval);
        $result = $from->diff($to);

        return ($result !== false) ? $result : $interval;
    }
1264822
public function work($interval = Resque::DEFAULT_INTERVAL, $blocking = false)
	{
		$this->updateProcLine('Starting');
		$this->startup();

		while(true) {
			if($this->shutdown) {
				break;
			}

			// Attempt to find and reserve a job
			$job = false;
			if(!$this->paused) {
				if($blocking === true) {
					$this->logger->log(Psr\Log\LogLevel::INFO, 'Starting blocking with timeout of {interval}', array('interval' => $interval));
					$this->updateProcLine('Waiting for ' . implode(',', $this->queues) . ' with blocking timeout ' . $interval);
				} else {
					$this->updateProcLine('Waiting for ' . implode(',', $this->queues) . ' with interval ' . $interval);
				}

				$job = $this->reserve($blocking, $interval);
			}

			if(!$job) {
				// For an interval of 0, break now - helps with unit testing etc
				if($interval == 0) {
					break;
				}

				if($blocking === false)
				{
					// If no job was found, we sleep for $interval before continuing and checking again
					$this->logger->log(Psr\Log\LogLevel::INFO, 'Sleeping for {interval}', array('interval' => $interval));
					if($this->paused) {
						$this->updateProcLine('Paused');
					}
					else {
						$this->updateProcLine('Waiting for ' . implode(',', $this->queues));
					}

					usleep($interval * 1000000);
				}

				continue;
			}

			$this->logger->log(Psr\Log\LogLevel::NOTICE, 'Starting work on {job}', array('job' => $job));
			Resque_Event::trigger('beforeFork', $job);
			$this->workingOn($job);

			$this->child = Resque::fork();

			// Forked and we're the child. Run the job.
			if ($this->child === 0 || $this->child === false) {
				$status = 'Processing ' . $job->queue . ' since ' . strftime('%F %T');
				$this->updateProcLine($status);
				$this->logger->log(Psr\Log\LogLevel::INFO, $status);
				$this->perform($job);
				if ($this->child === 0) {
					exit(0);
				}
			}

			if($this->child > 0) {
				// Parent process, sit and wait
				$status = 'Forked ' . $this->child . ' at ' . strftime('%F %T');
				$this->updateProcLine($status);
				$this->logger->log(Psr\Log\LogLevel::INFO, $status);

				// Wait until the child process finishes before continuing
				pcntl_wait($status);
				$exitStatus = pcntl_wexitstatus($status);
				if($exitStatus !== 0) {
					$job->fail(new Resque_Job_DirtyExitException(
						'Job exited with exit code ' . $exitStatus
					));
				}
			}

			$this->child = null;
			$this->doneWorking();
		}

		$this->unregisterWorker();
	}
703171
public function listen($interval = 5, $timeout = 0)
    {
        while (true) {
            // Process the current job if available
            // or sleep for a certain time
            if ($manager = $this->getManager($timeout)) {
                $manager->execute();
            } elseif ($interval > 0) {
                $this->sleep($interval);
            }
        }
    }
1256377
private function parseDateInterval($interval)
    {
        try {
            if (!$this->isInstanceOf($interval, 'DateInterval')) {
                $interval = new StringObject($interval);
                if ($interval->startsWith('P')) {
                    $interval = new \DateInterval($interval);
                } else {
                    $interval = \DateInterval::createFromDateString($interval);
                }
            }
        } catch (\Exception $e) {
            throw new DateTimeObjectException(DateTimeObjectException::MSG_INVALID_DATE_INTERVAL, [$interval]);
        }

        return $interval;
    }
598233
public function run($interval = self::CHECK_INTERVAL)
    {
        $this->start();

        $sleep = (int) ($interval * 1000000);
        while ($this->poll()) {
            usleep($sleep);
        }

        return $this->isSuccessful();
    }
70876
public function work($interval = ResqueWorkerBase::DEFAULT_INTERVAL, $blocking = false)
    {
        if ($interval !== null) {
            $this->interval = $interval;
        }

        $this->updateProcLine('Starting');
        $this->startup();

        while (true) {
            if (function_exists('pcntl_signal_dispatch')) {
                pcntl_signal_dispatch();
            }
            if ($this->shutdown) {
                break;
            }

            // Attempt to find and reserve a job
            $job = false;
            if (!$this->paused) {
                if ($blocking === true) {
                    $this->logger->log(
                        LogLevel::INFO,
                        'Starting blocking with timeout of {interval}',
                        ['interval' => $this->interval]
                    );
                    $this->updateProcLine(
                        'Waiting for ' . implode(',', $this->queues) . ' with blocking timeout ' . $this->interval
                    );
                } else {
                    $this->updateProcLine(
                        'Waiting for ' . implode(',', $this->queues) . ' with interval ' . $this->interval);
                }

                $job = $this->reserve($blocking, $this->interval);
            }

            if (!$job) {
                // For an interval of 0, break now - helps with unit testing etc
                if ($this->interval == 0) {
                    break;
                }

                if ($blocking === false) {
                    // If no job was found, we sleep for $this->interval before continuing and checking again
                    $this->logger->log(LogLevel::INFO, 'Sleeping for {interval}', ['interval' => $this->interval]);
                    if ($this->paused) {
                        $this->updateProcLine('Paused');
                    } else {
                        $this->updateProcLine('Waiting for ' . implode(',', $this->queues));
                    }

                    usleep($this->interval * 1000000);
                }

                continue;
            }

            $this->logger->log(LogLevel::NOTICE, 'Starting work on {job}', ['job' => $job]);
            $this->resqueInstance->events->trigger('beforeFork', $job);
            $this->workingOn($job);

            $this->child = $this->resqueInstance->fork();

            // Forked and we're the child. Run the job.
            if ($this->child === 0 || $this->child === false) {
                $status = 'Processing ' . $job->queue . ' since ' . date('d/m/Y h:i:s a');
                $this->updateProcLine($status);
                $this->logger->log(LogLevel::INFO, $status);
                $this->perform($job);
                if ($this->child === 0) {
                    exit(0);
                }
            }

            if ($this->child > 0) {
                // Parent process, sit and wait
                $status = 'Forked ' . $this->child . ' at ' . date('d/m/Y h:i:s a');
                $this->updateProcLine($status);
                $this->logger->log(LogLevel::INFO, $status);

                // Wait until the child process finishes before continuing
                pcntl_wait($status);
                $exitStatus = pcntl_wexitstatus($status);
                if ($exitStatus !== 0) {
                    $job->fail(new ResqueJobForceExitException(
                        'Job exited with exit code ' . $exitStatus
                    ));
                }
            }

            $this->child = null;
            $this->doneWorking();
        }

        $this->unregisterWorker();
    }
619083
public function set(int $offset, Period $interval): void
    {
        $this->get($offset);
        $this->intervals[$offset] = $interval;
    }
739516
public synchronized void setMaxInactiveInterval(int interval) {
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[SET_MAX_INACTIVE_INTERVAL], "interval= " + interval);
        }
        if (_maxInactiveInterval != interval) {
            _maxInactiveInterval = interval;
            maxInactWriteHit = true;
        }
    }
189922
public function start($interval = 1000000, $timeout = null, Closure $callback = null)
    {
        $this->startWatch($interval, $timeout, $callback);
    }
1208147
def set_interval(self, interval):
        """"""
        self._interval = interval
        if self.timer is not None:
            self.timer.setInterval(interval)
543119
public void start(IStore store, int interval) {
        synchronized (this) {
            _invalInterval = interval;
            _timer = new Timer(true);
            _invalTask = new InvalidationTask(store);
            _timer.schedule(_invalTask, _delay * 1000, _invalInterval * 1000);
        }
    }