Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```