Skip to content

api: deprecate box.session.push() usage #358

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

Merged
merged 1 commit into from
Nov 30, 2023
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 @@ -76,6 +76,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
- All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
ConnectionPool.<Request>Async methods. Instead you should use requests
objects + ConnectionPool.Do() (#241)
- box.session.push() usage: Future.AppendPush() and Future.GetIterator()
methods, ResponseIterator and TimeoutResponseIterator types (#324)

### Removed

Expand Down
6 changes: 6 additions & 0 deletions future.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ func NewFuture() (fut *Future) {

// AppendPush appends the push response to the future.
// Note: it works only before SetResponse() or SetError()
//
// Deprecated: the method will be removed in the next major version,
// use Connector.NewWatcher() instead of box.session.push().
func (fut *Future) AppendPush(resp *Response) {
fut.mutex.Lock()
defer fut.mutex.Unlock()
Expand Down Expand Up @@ -208,6 +211,9 @@ func (fut *Future) GetTyped(result interface{}) error {
//
// - box.session.push():
// https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_session/push/
//
// Deprecated: the method will be removed in the next major version,
// use Connector.NewWatcher() instead of box.session.push().
func (fut *Future) GetIterator() (it TimeoutResponseIterator) {
futit := &asyncResponseIterator{
fut: fut,
Expand Down
6 changes: 6 additions & 0 deletions response_it.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
)

// ResponseIterator is an interface for iteration over a set of responses.
//
// Deprecated: the method will be removed in the next major version,
// use Connector.NewWatcher() instead of box.session.push().
type ResponseIterator interface {
// Next tries to switch to a next Response and returns true if it exists.
Next() bool
Expand All @@ -16,6 +19,9 @@ type ResponseIterator interface {

// TimeoutResponseIterator is an interface that extends ResponseIterator
// and adds the ability to change a timeout for the Next() call.
//
// Deprecated: the method will be removed in the next major version,
// use Connector.NewWatcher() instead of box.session.push().
type TimeoutResponseIterator interface {
ResponseIterator
// WithTimeout allows to set up a timeout for the Next() call.
Expand Down