diff --git a/CHANGELOG.md b/CHANGELOG.md index 6121a22df..f4f37c61b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release. * Removed deprecated `pool` methods, related interfaces and tests are updated (#478). * Removed deprecated `box.session.push()` support: Future.AppendPush() and Future.GetIterator() methods, ResponseIterator and TimeoutResponseIterator types, - Future.pushes[] (#480). + Future.pushes[], Future.ready (#480, #497). * `LogAppendPushFailed` replaced with `LogBoxSessionPushUnsupported` (#480) ### Fixed diff --git a/connection.go b/connection.go index 62829772c..a37c6e9d6 100644 --- a/connection.go +++ b/connection.go @@ -934,7 +934,6 @@ func (conn *Connection) newFuture(req Request) (fut *Future) { ErrRateLimited, "Request is rate limited on client", } - fut.ready = nil fut.done = nil return } @@ -949,7 +948,6 @@ func (conn *Connection) newFuture(req Request) (fut *Future) { ErrConnectionClosed, "using closed connection", } - fut.ready = nil fut.done = nil shard.rmut.Unlock() return @@ -958,7 +956,6 @@ func (conn *Connection) newFuture(req Request) (fut *Future) { ErrConnectionNotReady, "client connection is not ready", } - fut.ready = nil fut.done = nil shard.rmut.Unlock() return @@ -967,7 +964,6 @@ func (conn *Connection) newFuture(req Request) (fut *Future) { ErrConnectionShutdown, "server shutdown in progress", } - fut.ready = nil fut.done = nil shard.rmut.Unlock() return @@ -1038,7 +1034,7 @@ func (conn *Connection) send(req Request, streamId uint64) *Future { conn.incrementRequestCnt() fut := conn.newFuture(req) - if fut.ready == nil { + if fut.done == nil { conn.decrementRequestCnt() return fut } diff --git a/future.go b/future.go index ed3d89cdc..0f882014a 100644 --- a/future.go +++ b/future.go @@ -15,7 +15,6 @@ type Future struct { mutex sync.Mutex resp Response err error - ready chan struct{} done chan struct{} } @@ -41,7 +40,6 @@ func (fut *Future) isDone() bool { // NewFuture creates a new empty Future for a given Request. func NewFuture(req Request) (fut *Future) { fut = &Future{} - fut.ready = make(chan struct{}, 1000000000) fut.done = make(chan struct{}) fut.req = req return fut @@ -62,7 +60,6 @@ func (fut *Future) SetResponse(header Header, body io.Reader) error { } fut.resp = resp - close(fut.ready) close(fut.done) return nil } @@ -77,7 +74,6 @@ func (fut *Future) SetError(err error) { } fut.err = err - close(fut.ready) close(fut.done) }