Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bring-shrubbery/golang-rpc-example
Example setup of golang's built-in RPC
https://github.com/bring-shrubbery/golang-rpc-example
example golang golang-rpc load-balancer rpc scheduler
Last synced: 13 days ago
JSON representation
Example setup of golang's built-in RPC
- Host: GitHub
- URL: https://github.com/bring-shrubbery/golang-rpc-example
- Owner: bring-shrubbery
- License: mit
- Created: 2020-06-09T09:46:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-12T21:03:30.000Z (about 3 years ago)
- Last Synced: 2024-06-21T18:54:27.963Z (5 months ago)
- Topics: example, golang, golang-rpc, load-balancer, rpc, scheduler
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Golang RPC Example
*🥑 Please star or fork this repository if you like it 👀*
This is an example of how to setup/use golang's built-in RPC. This example contains a client, scheduler (for primitive load balancing) and two servers, which are contacted by only the scheduler via RPC.
## How to run
To run the full example you will need to run 4 processes: client, scheduler and 2 servers. You can start all four processes by running following commands separately (in separate terminal windows) in order as they are presented below:
```bash
go run main.go -s1 -p 4001
``````bash
go run main.go -s2 -p 4002
``````bash
go run main.go -scheduler
``````bash
go run main.go
```