Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hlts2/round-robin

faster round-robin balancing algorithm written in golang
https://github.com/hlts2/round-robin

algorithm balancer balancing faster go golang golang-library goroutine-safe ip library lock-free round-robin thread-safe threadsafe

Last synced: 12 days ago
JSON representation

faster round-robin balancing algorithm written in golang

Awesome Lists containing this project

README

        

# round-robin
round-robin is balancing algorithm written in golang

## Installation

```shell
go get github.com/hlts2/round-robin
```

## Example

```go
rr, _ := roundrobin.New(
&url.URL{Host: "192.168.33.10"},
&url.URL{Host: "192.168.33.11"},
&url.URL{Host: "192.168.33.12"},
&url.URL{Host: "192.168.33.13"},
)

rr.Next() // {Host: "192.168.33.10"}
rr.Next() // {Host: "192.168.33.11"}
rr.Next() // {Host: "192.168.33.12"}
rr.Next() // {Host: "192.168.33.13"}
rr.Next() // {Host: "192.168.33.10"}
rr.Next() // {Host: "192.168.33.11"}
```
## Author
[hlts2](https://github.com/hlts2)

## LICENSE
round-robin released under MIT license, refer [LICENSE](https://github.com/hlts2/round-robin/blob/master/LICENSE) file.