Move cron-scheduling logic from SimpleWorker to CronWorkerRunner
[MAILPOET-2539]
This commit is contained in:
committed by
Jack Kitterhing
parent
acaaa9e2b2
commit
b7294bd86c
38
lib/Cron/CronWorkerInterface.php
Normal file
38
lib/Cron/CronWorkerInterface.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Cron;
|
||||
|
||||
use MailPoet\Models\ScheduledTask;
|
||||
|
||||
interface CronWorkerInterface {
|
||||
/** @return string */
|
||||
function getTaskType();
|
||||
|
||||
/** @return bool */
|
||||
function scheduleAutomatically();
|
||||
|
||||
/** @return bool */
|
||||
function supportsMultipleInstances();
|
||||
|
||||
/** @return bool */
|
||||
function checkProcessingRequirements();
|
||||
|
||||
function init();
|
||||
|
||||
/**
|
||||
* @param ScheduledTask $task
|
||||
* @param float $timer
|
||||
* @return bool
|
||||
*/
|
||||
function prepareTaskStrategy(ScheduledTask $task, $timer);
|
||||
|
||||
/**
|
||||
* @param ScheduledTask $task
|
||||
* @param float $timer
|
||||
* @return bool
|
||||
*/
|
||||
function processTaskStrategy(ScheduledTask $task, $timer);
|
||||
|
||||
/** @return \DateTimeInterface */
|
||||
function getNextRunDate();
|
||||
}
|
Reference in New Issue
Block a user