aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/RpcReceiver.php
blob: a6b53c4fd0be426cc43b9416ace603256d97cb4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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.
     * 
     * Generally you shouldn't use this method directly, 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
     */
    public function rpcCall(string $method, array $args);
}