scylladb / gocql

Package gocql implements a fast and robust ScyllaDB client for the Go programming language.
https://docs.scylladb.com/stable/using-scylla/drivers/cql-drivers/scylla-go-driver.html
BSD 3-Clause "New" or "Revised" License
181 stars 57 forks source link

It's impossible to implement a custom host selection policy #167

Closed isburmistrov closed 4 months ago

isburmistrov commented 5 months ago

We wanted to implement our own host selection policy because the existing ones don't satisfy our requirements, and realised it's basically impossible.

The problem is with type SelectedHost that must be returned by NextHost.

In SelectedHost, one of the methods return an unexposed interface: link. It would have been solvable perhaps, if token didn't use itself in the type definition:

type token interface {
    fmt.Stringer
    Less(token) bool
}

Can we please fix this weird thing, effectively prohibiting a custom host selection policy seems like a weird limitation.

sylwiaszunejko commented 4 months ago

Closing as we have issue covering that https://github.com/scylladb/gocql/issues/183