Mark Slee | 9f0c651 | 2007-02-28 23:58:26 +0000 | [diff] [blame] | 1 | // Copyright (c) 2006- Facebook |
| 2 | // Distributed under the Thrift Software License |
| 3 | // |
| 4 | // See accompanying file LICENSE or visit the Thrift site at: |
| 5 | // http://developers.facebook.com/thrift/ |
| 6 | |
Mark Slee | b3cb629 | 2007-02-01 22:55:00 +0000 | [diff] [blame] | 7 | #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_ |
| 8 | #define _THRIFT_SERVER_TTHREADEDSERVER_H_ 1 |
| 9 | |
| 10 | #include <server/TServer.h> |
| 11 | #include <transport/TServerTransport.h> |
| 12 | #include <concurrency/Thread.h> |
| 13 | |
| 14 | #include <boost/shared_ptr.hpp> |
| 15 | |
| 16 | namespace facebook { namespace thrift { namespace server { |
| 17 | |
| 18 | using namespace facebook::thrift::transport; |
| 19 | using namespace facebook::thrift::concurrency; |
| 20 | using namespace boost; |
| 21 | |
| 22 | class TThreadedServer : public TServer { |
| 23 | |
| 24 | public: |
| 25 | class Task; |
| 26 | |
| 27 | TThreadedServer(shared_ptr<TProcessor> processor, |
| 28 | shared_ptr<TServerTransport> serverTransport, |
| 29 | shared_ptr<TTransportFactory> transportFactory, |
| 30 | shared_ptr<TProtocolFactory> protocolFactory); |
| 31 | |
| 32 | virtual ~TThreadedServer(); |
| 33 | |
| 34 | virtual void serve(); |
| 35 | |
| 36 | protected: |
| 37 | shared_ptr<ThreadFactory> threadFactory_; |
| 38 | |
| 39 | }; |
| 40 | |
| 41 | }}} // facebook::thrift::server |
| 42 | |
| 43 | #endif // #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_ |