Mark Slee | b3cb629 | 2007-02-01 22:55:00 +0000 | [diff] [blame] | 1 | #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_ |
| 2 | #define _THRIFT_SERVER_TTHREADEDSERVER_H_ 1 |
| 3 | |
| 4 | #include <server/TServer.h> |
| 5 | #include <transport/TServerTransport.h> |
| 6 | #include <concurrency/Thread.h> |
| 7 | |
| 8 | #include <boost/shared_ptr.hpp> |
| 9 | |
| 10 | namespace facebook { namespace thrift { namespace server { |
| 11 | |
| 12 | using namespace facebook::thrift::transport; |
| 13 | using namespace facebook::thrift::concurrency; |
| 14 | using namespace boost; |
| 15 | |
| 16 | class TThreadedServer : public TServer { |
| 17 | |
| 18 | public: |
| 19 | class Task; |
| 20 | |
| 21 | TThreadedServer(shared_ptr<TProcessor> processor, |
| 22 | shared_ptr<TServerTransport> serverTransport, |
| 23 | shared_ptr<TTransportFactory> transportFactory, |
| 24 | shared_ptr<TProtocolFactory> protocolFactory); |
| 25 | |
| 26 | virtual ~TThreadedServer(); |
| 27 | |
| 28 | virtual void serve(); |
| 29 | |
| 30 | protected: |
| 31 | shared_ptr<ThreadFactory> threadFactory_; |
| 32 | |
| 33 | }; |
| 34 | |
| 35 | }}} // facebook::thrift::server |
| 36 | |
| 37 | #endif // #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_ |