Commit d8e71911 authored by Dave Watson's avatar Dave Watson Committed by Anton Likhtarov

update thrift to use managed connection

Summary:
Use the new managed connection code in folly.  Cleans things up a fair bit

The only catch was the current ConnectionManager code uses raw pointers, thrift expects shared_ptr so the request object can keep the channel around until the requests are finished

Test Plan: fbconfig -r thrift/lib/cpp2; fbmake runtests

Reviewed By: afrind@fb.com

Subscribers: trunkagent, njormrod, doug, fugalh, alandau, bmatheny, dcsommer, afrind

FB internal diff: D1519923

Tasks: 5002343
parent f760023d
......@@ -121,6 +121,15 @@ class ConnectionManager: public folly::DelayedDestruction {
size_t getNumConnections() const { return conns_.size(); }
template <typename F>
void iterateConns(F func) {
auto it = conns_.begin();
while ( it != conns_.end()) {
func(&(*it));
it++;
}
}
private:
class CloseIdleConnsCallback :
public folly::EventBase::LoopCallback,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment