aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Command
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Command')
-rw-r--r--lib/public/Command/IBus.php31
-rw-r--r--lib/public/Command/ICommand.php21
2 files changed, 52 insertions, 0 deletions
diff --git a/lib/public/Command/IBus.php b/lib/public/Command/IBus.php
new file mode 100644
index 00000000000..619b0c42109
--- /dev/null
+++ b/lib/public/Command/IBus.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+namespace OCP\Command;
+
+/**
+ * Interface IBus
+ *
+ * @since 8.1.0
+ */
+interface IBus {
+ /**
+ * Schedule a command to be fired
+ *
+ * @param \OCP\Command\ICommand | callable $command
+ * @since 8.1.0
+ */
+ public function push($command);
+
+ /**
+ * Require all commands using a trait to be run synchronous
+ *
+ * @param string $trait
+ * @since 8.1.0
+ */
+ public function requireSync($trait);
+}
diff --git a/lib/public/Command/ICommand.php b/lib/public/Command/ICommand.php
new file mode 100644
index 00000000000..33435ad22db
--- /dev/null
+++ b/lib/public/Command/ICommand.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+namespace OCP\Command;
+
+/**
+ * Interface ICommand
+ *
+ * @since 8.1.0
+ */
+interface ICommand {
+ /**
+ * Run the command
+ * @since 8.1.0
+ */
+ public function handle();
+}