forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Servertype 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.Connectinterface:
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) errorMetadata
Metadata
Assignees
Labels
1spgood first issueGood for newcomersGood for newcomersrefactoringCode refactoringCode refactoringteamEv2