summaryrefslogtreecommitdiffstats
path: root/lib/public/command
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-17 16:49:14 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-25 15:08:40 +0100
commit74ae7b8929a7fd3f539fd15efb9533424114a480 (patch)
tree4388660851beff515a0ec78a2bea199c9a057fb2 /lib/public/command
parentf5b62267325415b307cf2d47b69d11d4337536e4 (diff)
downloadnextcloud-server-74ae7b8929a7fd3f539fd15efb9533424114a480.tar.gz
nextcloud-server-74ae7b8929a7fd3f539fd15efb9533424114a480.zip
Add async command system to handle asynchronous operations
Diffstat (limited to 'lib/public/command')
-rw-r--r--lib/public/command/ibus.php18
-rw-r--r--lib/public/command/icommand.php16
2 files changed, 34 insertions, 0 deletions
diff --git a/lib/public/command/ibus.php b/lib/public/command/ibus.php
new file mode 100644
index 00000000000..707f8fd072d
--- /dev/null
+++ b/lib/public/command/ibus.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Command;
+
+interface IBus {
+ /**
+ * Schedule a command to be fired
+ *
+ * @param \OCP\Command\ICommand | callable $command
+ */
+ public function push($command);
+}
diff --git a/lib/public/command/icommand.php b/lib/public/command/icommand.php
new file mode 100644
index 00000000000..6de61258a41
--- /dev/null
+++ b/lib/public/command/icommand.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Command;
+
+interface ICommand {
+ /**
+ * Run the command
+ */
+ public function handle();
+}