PHP 클래스 Yalesov\Cron\Service\Cron

handle cron job registration, validation, scheduling, running, and cleanup
저자: yalesov ([email protected])
파일 보기 프로젝트 열기: heartsentwined/zf2-cron 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$em Doctrine\ORM\EntityManager the Doctrine ORM Entity Manager
$failureLogLifetime how long to keep failed (missed / error) cron job logs
$maxRunningTime maximum running time of each cron job
$pending wrapped the Repo function here to implement a (crude) cache feature
$scheduleAhead how long ahead to schedule cron jobs
$scheduleLifetime how long before a scheduled job is considered missed
$successLogLifetime how long to keep successfully completed cron job logs

공개 메소드들

메소드 설명
cleanLog ( ) : self delete old cron job logs
cleanup ( ) : self perform various cleanup work
getEm ( )
getFailureLogLifetime ( )
getMaxRunningtime ( )
getPending ( )
getScheduleAhead ( )
getScheduleLifeTime ( )
getSuccessLogLifetime ( )
process ( ) : self run cron jobs
recoverRunning ( )
register ( $code, $frequency, $callback, array $args = [] ) wrapper function
resetPending ( )
run ( ) : self main entry function
schedule ( ) : self schedule cron jobs
setEm ( EntityManager $em )
setFailureLogLifetime ( $failureLogLifetime )
setMaxRunningTime ( $maxRunningTime )
setScheduleAhead ( $scheduleAhead )
setScheduleLifetime ( $scheduleLifetime )
setSuccessLogLifetime ( $successLogLifetime )
tryLockJob ( Job $job ) : boolean try to acquire a lock on a cron job

메소드 상세

cleanLog() 공개 메소드

delete old cron job logs
public cleanLog ( ) : self
리턴 self

cleanup() 공개 메소드

perform various cleanup work
public cleanup ( ) : self
리턴 self

getEm() 공개 메소드

public getEm ( )

getFailureLogLifetime() 공개 메소드

getMaxRunningtime() 공개 메소드

public getMaxRunningtime ( )

getPending() 공개 메소드

public getPending ( )

getScheduleAhead() 공개 메소드

public getScheduleAhead ( )

getScheduleLifeTime() 공개 메소드

public getScheduleLifeTime ( )

getSuccessLogLifetime() 공개 메소드

process() 공개 메소드

run cron jobs
public process ( ) : self
리턴 self

recoverRunning() 공개 메소드

public recoverRunning ( )

register() 공개 정적인 메소드

wrapper function
또한 보기: Registry::register()
public static register ( $code, $frequency, $callback, array $args = [] )
$args array

resetPending() 공개 메소드

public resetPending ( )

run() 공개 메소드

1. schedule new cron jobs 2. process cron jobs 3. cleanup old logs
public run ( ) : self
리턴 self

schedule() 공개 메소드

schedule cron jobs
public schedule ( ) : self
리턴 self

setEm() 공개 메소드

public setEm ( EntityManager $em )
$em Doctrine\ORM\EntityManager

setFailureLogLifetime() 공개 메소드

public setFailureLogLifetime ( $failureLogLifetime )

setMaxRunningTime() 공개 메소드

public setMaxRunningTime ( $maxRunningTime )

setScheduleAhead() 공개 메소드

public setScheduleAhead ( $scheduleAhead )

setScheduleLifetime() 공개 메소드

public setScheduleLifetime ( $scheduleLifetime )

setSuccessLogLifetime() 공개 메소드

public setSuccessLogLifetime ( $successLogLifetime )

tryLockJob() 공개 메소드

set a job to 'running' only if it is currently 'pending'
public tryLockJob ( Job $job ) : boolean
$job Yalesov\Cron\Entity\Job
리턴 boolean

프로퍼티 상세

$em 보호되어 있는 프로퍼티

the Doctrine ORM Entity Manager
protected EntityManager,Doctrine\ORM $em
리턴 Doctrine\ORM\EntityManager

$failureLogLifetime 보호되어 있는 프로퍼티

how long to keep failed (missed / error) cron job logs
protected $failureLogLifetime

$maxRunningTime 보호되어 있는 프로퍼티

maximum running time of each cron job
protected $maxRunningTime

$pending 보호되어 있는 프로퍼티

wrapped the Repo function here to implement a (crude) cache feature
protected $pending

$scheduleAhead 보호되어 있는 프로퍼티

how long ahead to schedule cron jobs
protected $scheduleAhead

$scheduleLifetime 보호되어 있는 프로퍼티

how long before a scheduled job is considered missed
protected $scheduleLifetime

$successLogLifetime 보호되어 있는 프로퍼티

how long to keep successfully completed cron job logs
protected $successLogLifetime