-
Notifications
You must be signed in to change notification settings - Fork 11
Home
Remote procedure calls (RPC) allow one program to communicate with another and call functions or subroutines within the second program. For example one might want to programmatically control an array of LEDs connected to an eLua embedded device from a desktop Lua state. A simple implementation might be a protocol that would allow one to send commands numeric or text-based commands that would cause code to be executed in eLua that would change the state of the LEDs. As one needs new commands to change these LEDs, one would need to upload a new Lua program to handle changing functionality. In contrast to this ad-hoc method for remote calls, LuaRPC provides a more general way to manipulate the state and execution of a remote Lua environment.
When a client is connected to a LuaRPC server, it can interact with it in the following ways:
- assign values to new or existing variables in the server state
- get values from variables in the server state
- call functions to be executed on the server side using parameters of serializable types, with return values being sent back to the client
- create local userdata helpers (aliases) which provide short-hand access to remote state