Skip to content

Commit

Permalink
pool: add missing methods to the pooler interface
Browse files Browse the repository at this point in the history
I added methods that are implemented but not included in the pooler interface.
  • Loading branch information
maxim-konovalov committed May 6, 2024
1 parent a7d9162 commit f58a43d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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
### Changed

### Fixed
Expand Down
13 changes: 13 additions & 0 deletions pool/pooler.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
package pool

import (
"context"
"time"

"github.com/tarantool/go-tarantool/v2"
)

// PoolerTopology is the interface that must be implemented by a connection pool and
// describe topology methods.
type PoolerTopology 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 {
PoolerTopology

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)
Expand Down

0 comments on commit f58a43d

Please sign in to comment.