Move cron-scheduling logic from SimpleWorker to CronWorkerRunner

[MAILPOET-2539]
This commit is contained in:
Jan Jakeš
2019-11-25 13:36:12 +01:00
committed by Jack Kitterhing
parent acaaa9e2b2
commit b7294bd86c
6 changed files with 248 additions and 158 deletions

View 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();
}