Add methods to manage scheduled tasks

This commit is contained in:
Kijin Sung 2024-12-12 11:25:29 +09:00
parent caf882fed0
commit 5ff2f15485
2 changed files with 52 additions and 0 deletions

View file

@ -194,6 +194,30 @@ class Queue
return $driver->addTaskAtInterval($interval, $handler, $args, $options);
}
/**
* Get information about a scheduled task if it exists.
*
* @param int $task_srl
* @return ?object
*/
public static function getScheduledTask(int $task_srl): ?object
{
$driver = self::getDbDriver();
return $driver->getScheduledTask($task_srl);
}
/**
* Cancel a scheduled task.
*
* @param int $task_srl
* @return bool
*/
public static function cancelScheduledTask(int $task_srl): bool
{
$driver = self::getDbDriver();
return $driver->cancelScheduledTask($task_srl);
}
/**
* Check the process key.
*