blob: fb7ef64bbec53c6981d9cf44619aca6b8b28a080 [file] [log] [blame]
Mark Sleeb3cb6292007-02-01 22:55:00 +00001#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
10namespace facebook { namespace thrift { namespace server {
11
12using namespace facebook::thrift::transport;
13using namespace facebook::thrift::concurrency;
14using namespace boost;
15
16class 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_