aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/RpcReceiver.php
diff options
context:
space:
mode:
authorwinter2024-12-19 20:59:18 +0000
committerwinter2024-12-19 20:59:18 +0000
commit72b07245f44c73ed41bfcca2465a9ee34426a922 (patch)
tree57372703100ad792c95c665a568aabe8a763bfdf /Digitigrade/RpcReceiver.php
parent1e070a7a0097c74f8ac30678d39267f19c76f9f6 (diff)
implement follow relationships (untested)
does NOT implement the actual behaviour behind follows (receiving posts and such)
Diffstat (limited to 'Digitigrade/RpcReceiver.php')
-rw-r--r--Digitigrade/RpcReceiver.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/Digitigrade/RpcReceiver.php b/Digitigrade/RpcReceiver.php
new file mode 100644
index 0000000..f776bf2
--- /dev/null
+++ b/Digitigrade/RpcReceiver.php
@@ -0,0 +1,22 @@
+<?php
+namespace Digitigrade;
+
+/**
+ * Describes an object that can be acted on via an abstract RPC interface.
+ *
+ * If the object comes from a remote server, it will be contacted to complete the call,
+ * whereas if it is a local object, the call may be completed using regular function calls.
+ */
+interface RpcReceiver {
+ /**
+ * Makes a remote or local method call on this object.
+ *
+ * Implementors should not expose this method publicly, but should instead create wrapper
+ * methods with a nicer interface.
+ * @param string $method the name of the remote method to call
+ * @param array $args any arguments
+ * @return mixed results of the call
+ * @throws RpcException if there was an error contacting the other server
+ */
+ protected function rpcCall(string $method, array $args);
+} \ No newline at end of file