IParallelAwareJob.php 557 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\BackgroundJob;
  8. /**
  9. * @since 27.0.0
  10. */
  11. interface IParallelAwareJob {
  12. /**
  13. * Set this to false to prevent two Jobs from the same class from running in parallel
  14. *
  15. * @param bool $allow
  16. * @return void
  17. * @since 27.0.0
  18. */
  19. public function setAllowParallelRuns(bool $allow): void;
  20. /**
  21. * @return bool
  22. * @since 27.0.0
  23. */
  24. public function getAllowParallelRuns(): bool;
  25. }