Small library to provide remote proceedure calls in PHP over System V on Linux.
src | 3 months ago | ||
test | 4 months ago | ||
README.md | 4 months ago |
Small library to provide remote proceedure calls in PHP over System V on Linux.
Currently the project contains only one file. Simply add sysVcom.php to your project. Other files are for testing. The global files need to be set correctly for your project. In particular, a file needs to be created which is used as the buffer for the SysV system. In practice this is just used as a unique key but it must exist and be reachable by both client and server.
The following methods are use to invoke an RPC
rpc( $funcName, ...$params ); rpc_listen( &$caller_id, &$msgArr, $bBlock = true ); rpc_reply( $caller_id, $obj );
Invoke a remote proceedure call. All parameters are serialized and sent to the server. The call blocks until the results are returned.
The server must periodically call rpc_listen(). This call will populate the array &msgArr and $caller_id according to what message has been retrieved from the queue. The array &msgArr might contain other client messages which have only partially been recieved. The array must be used on subsequent calls to rpc_listen if it is not empty.
The unserialized object is returned.
This call must be invoked after the rpc instructions have been completed by the server. It is up to the server implementation whether or not these calls invoke a 'real' PHP function or something else. The call must pass back the results of the RPC in $obj. These will be serialized to back to the client. Note that the client is blocking on this call.