Skip to content

Commit 8b2be01

Browse files
maxim-konovalovoleg-jukovec
maxim-konovalov
authored andcommitted
pool: add missing methods to the pooler interface
I added methods that are implemented but not included in the pooler interface.
1 parent a7d9162 commit 8b2be01

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1313
connection and ctx is not canceled;
1414
also added logs for error case of `ConnectionPool.tryConnect()` calls in
1515
`ConnectionPool.controller()` and `ConnectionPool.reconnect()`
16+
- Methods that are implemented but not included in the pooler interface (#395).
17+
1618
### Changed
1719

1820
### Fixed

pool/pooler.go

+13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
package pool
22

33
import (
4+
"context"
45
"time"
56

67
"github.com/tarantool/go-tarantool/v2"
78
)
89

10+
// TopologyEditor is the interface that must be implemented by a connection pool.
11+
// It describes edit topology methods.
12+
type TopologyEditor interface {
13+
Add(ctx context.Context, instance Instance) error
14+
Remove(name string) error
15+
}
16+
917
// Pooler is the interface that must be implemented by a connection pool.
1018
type Pooler interface {
19+
TopologyEditor
20+
1121
ConnectedNow(mode Mode) (bool, error)
1222
Close() []error
23+
// CloseGraceful closes connections in the ConnectionPool gracefully. It waits
24+
// for all requests to complete.
25+
CloseGraceful() []error
1326
ConfiguredTimeout(mode Mode) (time.Duration, error)
1427
NewPrepared(expr string, mode Mode) (*tarantool.Prepared, error)
1528
NewStream(mode Mode) (*tarantool.Stream, error)

0 commit comments

Comments
 (0)