{"id":23897717,"url":"https://github.com/tkwonn/remote-procedure-call","last_synced_at":"2025-07-27T04:05:50.061Z","repository":{"id":219436003,"uuid":"749050694","full_name":"tkwonn/remote-procedure-call","owner":"tkwonn","description":"CLI Project #3","archived":false,"fork":false,"pushed_at":"2024-12-09T08:07:48.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T07:45:09.822Z","etag":null,"topics":["cli","rpc","socket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkwonn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-27T12:51:16.000Z","updated_at":"2024-12-09T08:07:52.000Z","dependencies_parsed_at":"2024-01-27T14:26:55.582Z","dependency_job_id":"7b66dd31-4f01-4843-8262-2ce8bbb0d128","html_url":"https://github.com/tkwonn/remote-procedure-call","commit_stats":null,"previous_names":["tkwonn/remote-procedure-call"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tkwonn/remote-procedure-call","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwonn%2Fremote-procedure-call","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwonn%2Fremote-procedure-call/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwonn%2Fremote-procedure-call/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwonn%2Fremote-procedure-call/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkwonn","download_url":"https://codeload.github.com/tkwonn/remote-procedure-call/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwonn%2Fremote-procedure-call/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267298519,"owners_count":24065882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","rpc","socket"],"created_at":"2025-01-04T17:17:25.458Z","updated_at":"2025-07-27T04:05:50.020Z","avatar_url":"https://github.com/tkwonn.png","language":"Python","readme":"# Remote Procedure Call\n\nRPC is an API architecture that allows a function or procedure to be executed on a remote machine within a network. It's commonly used when tasks need to be distributed across multiple machines or when making requests more efficiently.\n\n## Built with\n\nClient and server can operate on different computers and can be written in different programming languages.   \nThe implementation was carried out in the following programming languages:\n\n| Client-Server | Programming Language |\n|---------------|----------------------|\n| Client        | JavaScript (Node.js) |\n| Server        | Python               |\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/P71AG0MTjQ3LIj7oJfv55jJvq.svg)](https://asciinema.org/a/P71AG0MTjQ3LIj7oJfv55jJvq)\n\n## Server Functions\n\nThe server provides the following functions as RPC to the client:\n\n- `floor`: Returns the nearest integer by rounding down.\n  - **Params**: `double x`\n  - **Return**: `int`\n\n- `nroot`: Computes the value of `r` in the equation `x = r^n`.\n  - **Params**: `int n, int x`\n  - **Return**: `int`\n\n- `reverse`: Returns a new string that is the reverse of the input string.\n  - **Params**: `string s`\n  - **Return**: `string`\n\n- `isAnagram`: Checks if two strings are anagrams of each other.\n  - **Params**: `string s1, string s2`\n  - **Return**: `bool`\n\n## Implementation\n\n- On the server side, a hash map of \u003cstring, callable\u003e pairs is created to store the keys and values.\n- When a request arrives at the server, it refers to this table to find the function associated with the specified key, and passes the parameters received from the request to the function.\n- Parameter validation is performed before executing the function to ensure parameters are sent in the correct format and data type.\n- Multiple clients are supported using Python's threading and multiprocessing modules, assigning a unique ID to each request (process) to track which request comes from which client.\n\nIf an error occurs, the server returns a response to the client containing an error message like the following:\n\n```json\n{\n    \"id\": 1,\n    \"error\": \"Invalid parameter\"\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkwonn%2Fremote-procedure-call","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkwonn%2Fremote-procedure-call","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkwonn%2Fremote-procedure-call/lists"}