blob: 453eda54f73984a711044e25989010df8724caa5 [file] [log] [blame]
Mark Slee9f0c6512007-02-28 23:58:26 +00001// 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 Sleeb3cb6292007-02-01 22:55:00 +00007#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
16namespace facebook { namespace thrift { namespace server {
17
18using namespace facebook::thrift::transport;
19using namespace facebook::thrift::concurrency;
20using namespace boost;
21
22class 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_