Skip to content

Commit c9ff313

Browse files
author
maxim-konovalov
committed
refactor pooler faces
1 parent a7d9162 commit c9ff313

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pool/pooler.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
package pool
22

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

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

910
// Pooler is the interface that must be implemented by a connection pool.
1011
type Pooler interface {
12+
PoolerTopology
13+
1114
ConnectedNow(mode Mode) (bool, error)
1215
Close() []error
16+
// CloseGraceful closes connections in the ConnectionPool gracefully. It waits
17+
// for all requests to complete.
18+
CloseGraceful() []error
1319
ConfiguredTimeout(mode Mode) (time.Duration, error)
1420
NewPrepared(expr string, mode Mode) (*tarantool.Prepared, error)
1521
NewStream(mode Mode) (*tarantool.Stream, error)
@@ -155,3 +161,9 @@ type Pooler interface {
155161
ExecuteAsync(expr string, args interface{},
156162
mode Mode) *tarantool.Future
157163
}
164+
165+
// PoolerTopology is the interface that must be implemented by a connection pool and describe topology methods.
166+
type PoolerTopology interface {
167+
Add(ctx context.Context, instance Instance) error
168+
Remove(name string) error
169+
}

0 commit comments

Comments
 (0)