Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
example_p2c_test.go
p2c.go
p2c_test.go

README.md

P2C Balancer

TODO

Usage Example:

package main

import (
	"fmt"
	"log"
	"testing"

	"github.com/lafikl/liblb/r2"
)

func main() {
	lb := p2c.New("127.0.0.1:8009", "127.0.0.1:8008", "127.0.0.1:8007")
	for i := 0; i < 10; i++ {
		host, err := lb.Balance("")
		if err != nil {
			log.Fatal(err)
		}
		fmt.Printf("Send request #%d to host %s\n", i, host)
	}
}

P2C Balancer

TODO

Usage Example:

package main

import (
	"fmt"
	"log"
	"testing"

	"github.com/lafikl/liblb/r2"
)

func main() {
	lb := p2c.New("127.0.0.1:8009", "127.0.0.1:8008", "127.0.0.1:8007")
	for i := 0; i < 10; i++ {
		host, err := lb.Balance("")
		if err != nil {
			log.Fatal(err)
		}
		fmt.Printf("Send request #%d to host %s\n", i, host)
	}
}