Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hlts2/round-robin
- Owner: hlts2
- License: mit
- Created: 2018-07-17T14:59:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-14T12:22:53.000Z (about 1 year ago)
- Last Synced: 2024-10-13T14:15:15.903Z (26 days ago)
- Topics: algorithm, balancer, balancing, faster, go, golang, golang-library, goroutine-safe, ip, library, lock-free, round-robin, thread-safe, threadsafe
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 60
- Watchers: 4
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.