Arc RPC
Asynchronous Remote Classes make RPC simple
How does it work
Arc RPC allows you to remotely call functions on other processes or even other hardware using these few main concepts
- Ability to wrap existing class instances
- Mock that acts like the remote class
- Bi-directional
- Protocol agnostic
How to use it
Here is a basic example of using RPC with socket.io
client.js
// Include library for socket RPC clientslet ClientSocketRpc = ClientSocketRpc // Define `serverRpc` in higher scope for testing purposeslet serverRpc = null // Example remotely-callable class (this can be anything) // Example method async { console // Call remote as if it was a local class instance await rpcclass // This is garuanteed to be afterwards, as ES7 awaits are used console } // Create RPC to server over socket.io socket, predefined encryption key, with an instance of the example client classserverRpc = "127.0.0.1" 9919 Buffer
server.js
// Include library for socket RPC serverslet ServerSocketRpcMaster = ServerSocketRpcMaster // Example remotely-callable class (this can be anything) async { console } // Create RPC master/listener, on socket.io connection, predefined encryption key, with an instance of the example server classlet rpcMaster = 9919 Buffer // Listen for new clientsrpcMaster
Basic documentation
I'll get to completing this later