Skip to content
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: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 0 additions & 4 deletions future.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Future struct {
mutex sync.Mutex
resp Response
err error
ready chan struct{}
done chan struct{}
}

Expand All @@ -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
Expand All @@ -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
}
Expand All @@ -77,7 +74,6 @@ func (fut *Future) SetError(err error) {
}
fut.err = err

close(fut.ready)
close(fut.done)
}

Expand Down
Loading