[thrift] Add optional callback inside of serve()
authordweatherford <dev-null@apache.org>
Tue, 19 Jun 2007 23:10:19 +0000 (23:10 +0000)
committerdweatherford <dev-null@apache.org>
Tue, 19 Jun 2007 23:10:19 +0000 (23:10 +0000)
commit589859984f43af1ed0f9ee45ce8374a0d1640813
tree542ef2b0e9b7979373ab9736bafffc89995e47b0
parent3e5d2d72b4f48e2008462fbb9ac86f76011ceb91
[thrift] Add optional callback inside of serve()

Summary: If enabled, the callback function will be run after the listening socket is opened and the event loop initialized, just prior to calling event_loop()

This is handy if you want to defer some of your initialization until after the socket is open -- allowing clients to connect, but not processing requests until the initialization is complete. I use this in the Synapse tablet server to minimize the communications interruption that happens during a tablet split (replaying commit logs after opening the listening socket).

Review: mcslee
Test Plan: compiled it into Synapse's tablet server
Revert: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665137 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/src/server/TNonblockingServer.cpp
lib/cpp/src/server/TNonblockingServer.h