2026-05-11 09:35:54 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OCP\TaskProcessing;
|
|
|
|
|
|
|
|
|
|
use OCP\Files\File;
|
|
|
|
|
use OCP\TaskProcessing\Exception\ProcessingException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This is the interface that is implemented by apps that
|
2026-05-28 08:50:08 -04:00
|
|
|
* implement a task processing provider
|
|
|
|
|
* @since 35.0.0
|
2026-05-11 09:35:54 -04:00
|
|
|
*/
|
2026-06-01 09:58:00 -04:00
|
|
|
interface ISynchronousOptionsAwareProvider extends ISynchronousProvider {
|
2026-05-11 09:35:54 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the shape of optional output parameters
|
|
|
|
|
*
|
|
|
|
|
* @param null|string $userId The user that created the current task
|
|
|
|
|
* @param array<string, list<numeric|string|File>|numeric|string|File> $input The task input
|
|
|
|
|
* @param callable(float):bool $reportProgress Report the task progress. If this returns false, that means the task was cancelled and processing should be stopped.
|
2026-05-28 08:50:08 -04:00
|
|
|
* @param SynchronousProviderOptions $options The task options
|
2026-05-11 09:35:54 -04:00
|
|
|
* @psalm-return array<string, list<numeric|string>|numeric|string>
|
|
|
|
|
* @throws ProcessingException
|
2026-05-27 10:48:45 -04:00
|
|
|
* @since 35.0.0
|
2026-05-11 09:35:54 -04:00
|
|
|
*/
|
2026-06-01 05:48:11 -04:00
|
|
|
#[\Override]
|
2026-05-28 08:50:08 -04:00
|
|
|
public function process(
|
|
|
|
|
?string $userId,
|
|
|
|
|
array $input,
|
|
|
|
|
callable $reportProgress,
|
|
|
|
|
SynchronousProviderOptions $options = new SynchronousProviderOptions(),
|
|
|
|
|
): array;
|
2026-05-11 09:35:54 -04:00
|
|
|
}
|