We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For proton cluster, need to support cluster ip addresses
conn := proton.OpenDB(&proton.Options{ Addr: []string{"ip1:8463","ip2:8463,"ip3:8463"}, Auth: proton.Auth{ Username: "default", Password: "", }, }) var value int conn.QueryRow("SELECT 300").Scan(&value) fmt.Println(value)
implement a round robin based query load balancing
The text was updated successfully, but these errors were encountered:
Go driver does poll all cluster IP and select the first IP that connects successfully.
func (ch *proton) dial(ctx context.Context) (conn *connect, err error) { connID := int(atomic.AddInt64(&ch.connID, 1)) for num := range ch.opt.Addr { if ch.opt.ConnOpenStrategy == ConnOpenRoundRobin { num = int(connID) % len(ch.opt.Addr) } if conn, err = dial(ctx, ch.opt.Addr[num], connID, ch.opt); err == nil { return conn, nil } } return nil, err }
Sorry, something went wrong.
No branches or pull requests
For proton cluster, need to support cluster ip addresses
implement a round robin based query load balancing
The text was updated successfully, but these errors were encountered: