forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Labels
1spgood first issueGood for newcomersGood for newcomersrefactoringCode refactoringCode refactoringteamEv2
Description
The current interface:
func Connect(ctx context.Context, dialers map[string]tarantool.Dialer, connOpts tarantool.Opts) (*ConnectionPool, error)
It has two disadvantages:
- It does not allow to use different connect options for different connections.
- It could be tricky to initialize a map of dialers.
I suggest a small refactoring:
- Add the
Server
type to the pool package, which would describe one server for a pool:
type Server struct {
Id string
Dialer tarantool.Dialer
Opts tarantool.Opts
}
- Update the
pool.Connect
interface:
func Connect(ctx context.Context, servers ...Server) (*ConnectionPool, error)
- Update
pool.ConnectWithOpts
:
func ConnectWithOpts(ctx context.Context, opts Opts, servers ...Server) (*ConnectionPool, error)
- Update
pool.Add
:
func (p *ConnectionPool) Add(ctx context.Context, server Server) error
Metadata
Metadata
Assignees
Labels
1spgood first issueGood for newcomersGood for newcomersrefactoringCode refactoringCode refactoringteamEv2