From 60bbf1dda6e5f5d092cfdcc98cf2ada78b235f02 Mon Sep 17 00:00:00 2001 From: Oleg Jukovec Date: Wed, 29 Nov 2023 19:26:25 +0300 Subject: [PATCH] api: deprecate box.session.push() usage `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 --- CHANGELOG.md | 2 ++ future.go | 6 ++++++ response_it.go | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eb1b0968..36f5c08db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release. - All ConnectionPool., ConnectionPool.Typed and ConnectionPool.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 diff --git a/future.go b/future.go index 09229788c..e7f7dae19 100644 --- a/future.go +++ b/future.go @@ -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() @@ -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, diff --git a/response_it.go b/response_it.go index 3ae296449..404c68a51 100644 --- a/response_it.go +++ b/response_it.go @@ -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 @@ -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.