Skip to content

Commit cabe16e

Browse files
committedNov 30, 2023
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
1 parent b2b800b commit cabe16e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
7676
- All ConnectionPool.<Request>, ConnectionPool.<Request>Typed and
7777
ConnectionPool.<Request>Async methods. Instead you should use requests
7878
objects + ConnectionPool.Do() (#241)
79+
- box.session.push() usage: Future.AppendPush() and Future.GetIterator()
80+
methods, ResponseIterator and TimeoutResponseIterator types (#324)
7981

8082
### Removed
8183

‎future.go

+6
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ func NewFuture() (fut *Future) {
128128

129129
// AppendPush appends the push response to the future.
130130
// Note: it works only before SetResponse() or SetError()
131+
//
132+
// Deprecated: the method will be removed in the next major version,
133+
// use Connector.NewWatcher() instead of box.session.push().
131134
func (fut *Future) AppendPush(resp *Response) {
132135
fut.mutex.Lock()
133136
defer fut.mutex.Unlock()
@@ -208,6 +211,9 @@ func (fut *Future) GetTyped(result interface{}) error {
208211
//
209212
// - box.session.push():
210213
// https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_session/push/
214+
//
215+
// Deprecated: the method will be removed in the next major version,
216+
// use Connector.NewWatcher() instead of box.session.push().
211217
func (fut *Future) GetIterator() (it TimeoutResponseIterator) {
212218
futit := &asyncResponseIterator{
213219
fut: fut,

‎response_it.go

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import (
55
)
66

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.