Skip to content

Commit f58a43d

Browse files
author
maxim-konovalov
committed
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 f58a43d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ 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
1617
### Changed
1718

1819
### Fixed

pool/pooler.go

Lines changed: 13 additions & 0 deletions
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+
// PoolerTopology is the interface that must be implemented by a connection pool and
11+
// describe topology methods.
12+
type PoolerTopology 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+
PoolerTopology
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)