summaryrefslogtreecommitdiffstats
path: root/lib/public/BackgroundJob/IJob.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/BackgroundJob/IJob.php')
-rw-r--r--lib/public/BackgroundJob/IJob.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/public/BackgroundJob/IJob.php b/lib/public/BackgroundJob/IJob.php
index 3c2da42bf88..24d8e7aad4a 100644
--- a/lib/public/BackgroundJob/IJob.php
+++ b/lib/public/BackgroundJob/IJob.php
@@ -29,7 +29,10 @@ namespace OCP\BackgroundJob;
use OCP\ILogger;
/**
- * Interface IJob
+ * This interface represend a backgroud job run with cron
+ *
+ * To implement a background job, you must extend either \OCP\BackgroundJob\Job,
+ * \OCP\BackgroundJob\TimedJob or \OCP\BackgroundJob\QueuedJob
*
* @since 7.0.0
*/
@@ -49,10 +52,26 @@ interface IJob {
* @param IJobList $jobList The job list that manages the state of this job
* @param ILogger|null $logger
* @since 7.0.0
+ * @deprecated since 25.0.0 Use start() instead. This method will be removed
+ * with the ILogger interface
*/
public function execute(IJobList $jobList, ILogger $logger = null);
/**
+ * Start the background job with the registered argument
+ *
+ * This methods will take care of running the background job, of initializing
+ * the state and cleaning up the job list after running the job.
+ *
+ * For common background job scenario, you will want to use TimedJob or QueuedJob
+ * instead of overwritting this method.
+ *
+ * @param IJobList $jobList The job list that manages the state of this job
+ * @since 25.0.0
+ */
+ public function start(IJobList $jobList): void;
+
+ /**
* @since 7.0.0
*/
public function setId(int $id);