\Imi\CronCronManager

定时任务管理器

Summary

Methods
Properties
Constants
__init()
addCron()
getRealTasks()
getTask()
getSocketFile()
No public properties found
No constants found
No protected methods found
$tasks
$socketFile
N/A
No private methods found
$realTasks
N/A

Properties

$tasks

$tasks : array

注入的任务列表

Type

array

$socketFile

$socketFile : string

socket 文件路径

不支持 samba 文件共享

Type

string

$realTasks

$realTasks : array<mixed,\Imi\Cron\CronTask>

真实的任务对象列表

Type

array<mixed,\Imi\Cron\CronTask>

Methods

__init()

__init() 

addCron()

addCron(string  $id, string  $type, callable|string  $task, array  $cronRules, mixed  $data, float  $lockExpire = 3, string|null  $unique = null, string|null  $redisPool = null, float  $lockWaitTimeout = 3, boolean  $force = false) : void

增加 Cron 任务

Parameters

string $id
string $type
callable|string $task
array $cronRules
mixed $data
float $lockExpire
string|null $unique
string|null $redisPool
float $lockWaitTimeout
boolean $force

getRealTasks()

getRealTasks() : array<mixed,\Imi\Cron\CronTask>

Get 真实的任务对象列表

Returns

array<mixed,\Imi\Cron\CronTask>

getTask()

getTask(string  $id) : \Imi\Cron\CronTask|null

获取任务对象

Parameters

string $id

Returns

\Imi\Cron\CronTask|null

getSocketFile()

getSocketFile() : string

socket 文件路径

Returns

string