Mark Slee | d788b2e | 2006-09-07 01:26:35 +0000 | [diff] [blame] | 1 | #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_ |
| 2 | #define _THRIFT_SERVER_TTHREADPOOLSERVER_H_ 1 |
Marc Slemko | 3545234 | 2006-08-03 19:01:37 +0000 | [diff] [blame] | 3 | |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 4 | #include <concurrency/ThreadManager.h> |
| 5 | #include <server/TServer.h> |
| 6 | #include <transport/TServerTransport.h> |
| 7 | |
| 8 | #include <boost/shared_ptr.hpp> |
Marc Slemko | 3545234 | 2006-08-03 19:01:37 +0000 | [diff] [blame] | 9 | |
| 10 | namespace facebook { namespace thrift { namespace server { |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 11 | |
| 12 | using namespace facebook::thrift::concurrency; |
| 13 | using namespace facebook::thrift::transport; |
| 14 | using namespace boost; |
| 15 | |
| 16 | class TThreadPoolServer : public TServer { |
| 17 | public: |
| 18 | |
| 19 | class Task; |
| 20 | |
| 21 | TThreadPoolServer(shared_ptr<TProcessor> processor, |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 22 | shared_ptr<TServerTransport> serverTransport, |
Mark Slee | d788b2e | 2006-09-07 01:26:35 +0000 | [diff] [blame] | 23 | shared_ptr<TTransportFactory> transportFactory, |
Mark Slee | 4af6ed7 | 2006-10-25 19:02:49 +0000 | [diff] [blame^] | 24 | shared_ptr<TProtocolFactory> protocolFactory, |
| 25 | shared_ptr<ThreadManager> threadManager); |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 26 | |
| 27 | virtual ~TThreadPoolServer(); |
| 28 | |
Mark Slee | 794993d | 2006-09-20 01:56:10 +0000 | [diff] [blame] | 29 | virtual void serve(); |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 30 | |
| 31 | protected: |
| 32 | |
Marc Slemko | 1669885 | 2006-08-04 03:16:10 +0000 | [diff] [blame] | 33 | shared_ptr<ThreadManager> threadManager_; |
| 34 | |
| 35 | }; |
| 36 | |
Marc Slemko | 3545234 | 2006-08-03 19:01:37 +0000 | [diff] [blame] | 37 | }}} // facebook::thrift::server |
| 38 | |
Mark Slee | d788b2e | 2006-09-07 01:26:35 +0000 | [diff] [blame] | 39 | #endif // #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_ |