Skip to content

pool: Add pool Doer interface like tarantool client Doer #434

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 7 additions & 1 deletion pool/pooler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ type TopologyEditor interface {
Remove(name string) error
}

// Doer is an interface that performs requests asynchronously.
type Doer interface {
// Do performs a request asynchronously.
Do(req tarantool.Request, mode Mode) (fut *tarantool.Future)
}

// Pooler is the interface that must be implemented by a connection pool.
type Pooler interface {
TopologyEditor
Doer

ConnectedNow(mode Mode) (bool, error)
Close() []error
Expand All @@ -28,7 +35,6 @@ type Pooler interface {
NewStream(mode Mode) (*tarantool.Stream, error)
NewWatcher(key string, callback tarantool.WatchCallback,
mode Mode) (tarantool.Watcher, error)
Do(req tarantool.Request, mode Mode) (fut *tarantool.Future)

// Deprecated: the method will be removed in the next major version,
// use a PingRequest object + Do() instead.
Expand Down
Loading