aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Async
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Async')
-rw-r--r--lib/public/Async/Enum/BlockActivity.php18
-rw-r--r--lib/public/Async/Enum/BlockStatus.php20
-rw-r--r--lib/public/Async/Enum/ProcessExecutionTime.php17
-rw-r--r--lib/public/Async/IAsyncProcess.php20
4 files changed, 75 insertions, 0 deletions
diff --git a/lib/public/Async/Enum/BlockActivity.php b/lib/public/Async/Enum/BlockActivity.php
new file mode 100644
index 00000000000..ee8cf12d825
--- /dev/null
+++ b/lib/public/Async/Enum/BlockActivity.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Async\Enum;
+
+enum BlockActivity: int {
+ case STARTING = 0;
+ case DEBUG = 1;
+ case NOTICE = 2;
+ case WARNING = 3;
+ case ERROR = 4;
+ case ENDING = 9;
+}
diff --git a/lib/public/Async/Enum/BlockStatus.php b/lib/public/Async/Enum/BlockStatus.php
new file mode 100644
index 00000000000..83485880a8e
--- /dev/null
+++ b/lib/public/Async/Enum/BlockStatus.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Async\Enum;
+
+enum BlockStatus: int {
+ case PREP = 0;
+ case STANDBY = 1;
+ case RUNNING = 4;
+
+ case BLOCKER = 7;
+ case ERROR = 8;
+ case SUCCESS = 9;
+}
diff --git a/lib/public/Async/Enum/ProcessExecutionTime.php b/lib/public/Async/Enum/ProcessExecutionTime.php
new file mode 100644
index 00000000000..600bdce3c91
--- /dev/null
+++ b/lib/public/Async/Enum/ProcessExecutionTime.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Async\Enum;
+
+enum ProcessExecutionTime: int {
+ case NOW = 0;
+ case ASAP = 1;
+ case LATER = 2;
+ case ON_REQUEST = 9;
+}
diff --git a/lib/public/Async/IAsyncProcess.php b/lib/public/Async/IAsyncProcess.php
new file mode 100644
index 00000000000..9e32178a1cf
--- /dev/null
+++ b/lib/public/Async/IAsyncProcess.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Async;
+
+use OC\Async\IBlockInterface;
+use OCP\Async\Enum\ProcessExecutionTime;
+
+interface IAsyncProcess {
+ public function exec(\Closure $closure, ...$params): IBlockInterface;
+
+ public function invoke(callable $obj, ...$params): IBlockInterface;
+
+ public function call(string $class, ...$params): IBlockInterface;
+
+ public function async(ProcessExecutionTime $time = ProcessExecutionTime::NOW): string;
+}