Skip to content

Commit

Permalink
api: deprecate box.session.push() usage
Browse files Browse the repository at this point in the history
`box.session.push` is deprecated starting from Tarantool 3.0. We are
going to remove the feature from the connector in a next major
release.

Part of #324
  • Loading branch information
oleg-jukovec committed Nov 29, 2023
1 parent b2b800b commit 60bbf1d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit 60bbf1d

Please sign in to comment.