ISynchronousProvider.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\TaskProcessing;
  8. use OCP\Files\File;
  9. use OCP\TaskProcessing\Exception\ProcessingException;
  10. /**
  11. * This is the interface that is implemented by apps that
  12. * implement a task processing provider
  13. * @since 30.0.0
  14. */
  15. interface ISynchronousProvider extends IProvider {
  16. /**
  17. * Returns the shape of optional output parameters
  18. *
  19. * @param null|string $userId The user that created the current task
  20. * @param array<string, list<numeric|string|File>|numeric|string|File> $input The task input
  21. * @param callable(float):bool $reportProgress Report the task progress. If this returns false, that means the task was cancelled and processing should be stopped.
  22. * @psalm-return array<string, list<numeric|string>|numeric|string>
  23. * @throws ProcessingException
  24. *@since 30.0.0
  25. */
  26. public function process(?string $userId, array $input, callable $reportProgress): array;
  27. }