-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thriftbp: Add background refresh for ttlClients
For every ttlClient that has a ttl, add a background goroutine to refresh the connection when ttl hits. This adds one goroutine per connection in the pool, until the connection fails to refresh. Both IsOpen and Call are protected by a locked state now. When ttlClient is used, we always call IsOpen first then Call, and in theory these 2 calls might not be using the same connection (e.g. IsOpen is called right before the connection expires), but even in that scenario, Call would use a freshly refreshed connection, so things should still work.
- Loading branch information
Showing
3 changed files
with
285 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.