Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pool: add missing methods to the pooler interface #395

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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"
)

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