2023-04-20 07:55:28 -04:00
|
|
|
<?php
|
|
|
|
|
|
2023-04-20 09:23:13 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-04-20 09:23:13 -04:00
|
|
|
*/
|
2023-04-20 07:55:28 -04:00
|
|
|
namespace OCP\BackgroundJob;
|
|
|
|
|
|
2023-04-20 09:23:13 -04:00
|
|
|
/**
|
|
|
|
|
* @since 27.0.0
|
|
|
|
|
*/
|
2023-04-20 07:55:28 -04:00
|
|
|
interface IParallelAwareJob {
|
|
|
|
|
/**
|
|
|
|
|
* Set this to false to prevent two Jobs from the same class from running in parallel
|
|
|
|
|
*
|
|
|
|
|
* @param bool $allow
|
|
|
|
|
* @return void
|
|
|
|
|
* @since 27.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function setAllowParallelRuns(bool $allow): void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return bool
|
|
|
|
|
* @since 27.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getAllowParallelRuns(): bool;
|
|
|
|
|
}
|