summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-05-17 11:54:31 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-01 17:11:12 +0200
commitf5ff8136ac3e26cc6b7676dd1f9d307736ad1918 (patch)
tree9a4121721e4a2fe599897b3090a351a5b72d0844 /lib/public
parent5aefdc399eb17a86f3c2b59713ca6448479f99fd (diff)
downloadnextcloud-server-f5ff8136ac3e26cc6b7676dd1f9d307736ad1918.tar.gz
nextcloud-server-f5ff8136ac3e26cc6b7676dd1f9d307736ad1918.zip
feat(TaskProcessingApi): Add endpoint for getting the next task
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/TaskProcessing/IManager.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/public/TaskProcessing/IManager.php b/lib/public/TaskProcessing/IManager.php
index 87700917c7e..e9d3f6b0eb8 100644
--- a/lib/public/TaskProcessing/IManager.php
+++ b/lib/public/TaskProcessing/IManager.php
@@ -38,6 +38,14 @@ interface IManager {
public function getProviders(): array;
/**
+ * @param string $taskType
+ * @return IProvider
+ * @throws Exception
+ * @since 30.0.0
+ */
+ public function getPreferredProvider(string $taskType);
+
+ /**
* @return array<string,array{name: string, description: string, inputShape: ShapeDescriptor[], optionalInputShape: ShapeDescriptor[], outputShape: ShapeDescriptor[], optionalOutputShape: ShapeDescriptor[]}>
* @since 30.0.0
*/
@@ -101,13 +109,14 @@ interface IManager {
public function setTaskProgress(int $id, float $progress): bool;
/**
- * @param string|null $taskTypeId
+ * @param list<string> $taskTypeIds
+ * @param list<int> $taskIdsToIgnore
* @return Task
* @throws Exception If the query failed
* @throws NotFoundException If no task could not be found
* @since 30.0.0
*/
- public function getNextScheduledTask(?string $taskTypeId = null): Task;
+ public function getNextScheduledTask(array $taskTypeIds = [], array $taskIdsToIgnore = []): Task;
/**
* @param int $id The id of the task
@@ -154,4 +163,13 @@ interface IManager {
* @since 30.0.0
*/
public function prepareInputData(Task $task): array;
+
+ /**
+ * Changes the task status to STATUS_RUNNING and, if successful, returns True.
+ *
+ * @param Task $task
+ * @return bool
+ * @since 30.0.0
+ */
+ public function lockTask(Task $task): bool;
}