blob: b8f8b47fc91691be9443946c76b007c69edb12a7 [file] [log] [blame]
Mark Sleed788b2e2006-09-07 01:26:35 +00001#ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_
2#define _THRIFT_SERVER_TTHREADPOOLSERVER_H_ 1
Marc Slemko35452342006-08-03 19:01:37 +00003
Marc Slemko16698852006-08-04 03:16:10 +00004#include <concurrency/ThreadManager.h>
5#include <server/TServer.h>
6#include <transport/TServerTransport.h>
7
8#include <boost/shared_ptr.hpp>
Marc Slemko35452342006-08-03 19:01:37 +00009
10namespace facebook { namespace thrift { namespace server {
Marc Slemko16698852006-08-04 03:16:10 +000011
12using namespace facebook::thrift::concurrency;
13using namespace facebook::thrift::transport;
14using namespace boost;
15
16class TThreadPoolServer : public TServer {
17public:
18
19 class Task;
20
21 TThreadPoolServer(shared_ptr<TProcessor> processor,
Marc Slemko16698852006-08-04 03:16:10 +000022 shared_ptr<TServerTransport> serverTransport,
Mark Sleed788b2e2006-09-07 01:26:35 +000023 shared_ptr<TTransportFactory> transportFactory,
24 shared_ptr<ThreadManager> threadManager,
25 shared_ptr<TServerOptions> options);
Marc Slemko16698852006-08-04 03:16:10 +000026
27 virtual ~TThreadPoolServer();
28
Mark Slee794993d2006-09-20 01:56:10 +000029 virtual void serve();
Marc Slemko16698852006-08-04 03:16:10 +000030
31protected:
32
Marc Slemko16698852006-08-04 03:16:10 +000033 shared_ptr<ThreadManager> threadManager_;
34
35};
36
Marc Slemko35452342006-08-03 19:01:37 +000037}}} // facebook::thrift::server
38
Mark Sleed788b2e2006-09-07 01:26:35 +000039#endif // #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_