diff --git a/CHANGELOG.md b/CHANGELOG.md index a5cc700e..4ef3cb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release. connection and ctx is not canceled; also added logs for error case of `ConnectionPool.tryConnect()` calls in `ConnectionPool.controller()` and `ConnectionPool.reconnect()` +- Methods that are implemented but not included in the pooler interface (#395). + ### Changed ### Fixed diff --git a/pool/pooler.go b/pool/pooler.go index 975162d3..d4c0f1b5 100644 --- a/pool/pooler.go +++ b/pool/pooler.go @@ -1,15 +1,28 @@ package pool import ( + "context" "time" "github.com/tarantool/go-tarantool/v2" ) +// TopologyEditor is the interface that must be implemented by a connection pool. +// It describes edit topology methods. +type TopologyEditor interface { + Add(ctx context.Context, instance Instance) error + Remove(name string) error +} + // Pooler is the interface that must be implemented by a connection pool. type Pooler interface { + TopologyEditor + ConnectedNow(mode Mode) (bool, error) Close() []error + // CloseGraceful closes connections in the ConnectionPool gracefully. It waits + // for all requests to complete. + CloseGraceful() []error ConfiguredTimeout(mode Mode) (time.Duration, error) NewPrepared(expr string, mode Mode) (*tarantool.Prepared, error) NewStream(mode Mode) (*tarantool.Stream, error)