-
Notifications
You must be signed in to change notification settings - Fork 31
Remote Procedure Call RPC
Remote Procedure Call (RPC) is a mechanism which allows a program to invoke a function that is defined in another address space. If a user, A, writes a function and shares it with another user B, then B can invoke the shared function in A's program. The return value of the function is retrieved by B, which can then be used in B's program.
RPC is implemented using the Source Academy Module feature. The module is named 'rpc' and exposes three functions, namely connect
, share
and executeAfter
.
The RPC also allows sharing of values in Source programs. These include numbers, strings, booleans, null and undefined. The sharing of arrays of arbitrary nesting is also allowed, along with lists and pairs which resolve into arrays themselves.
To start off, the functions mentioned above must be imported from the module 'rpc' using Source's import
statement. The behaviour of the aforementioned functions is described as follows: -
This system requires an understanding and familiarity with a broad range of CS topics/subdomains. The following is a non-exhaustive but comprehensive list of topics and resources that should help a developer get started:
Since this project is written in Typescript, familiarity with Typescript/Javascript (JS) is required.
- How Javascript works in the browser
- [https://www.youtube.com/watch?v=cCOL7MC4Pl0](The JavaScript Event Loop explained [Video])
- An understanding of asynchronous and concurrent program execution
- Home
- Overview
- System Implementation
-
Development Guide
- Getting Started
- Repository Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Build System
- Source Modules
- FAQs
Try out Source Academy here.
Check out the Source Modules generated API documentation here.