Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
From d645a23c026536598f7a922d2ebaeb599f4dcfdc Mon Sep 17 00:00:00 2001
From: Adam Simpkins <simpkins@fb.com>
Date: Mon, 19 Apr 2010 19:09:25 +0000
Subject: [PATCH 27/33] thrift: update server classes to accept
TProcessorFactory objects
Summary:
Update TSimpleServer, TThreadedServer, TThreadPoolServer, and
TNonblockingServer constructors to accept either a TProcessorFactory or
a TProcessor.
Unfortunately, using boost::shared_ptr makes this somewhat more
annoying, since shared_ptr's are no help for overload resolution:
each shared_ptr type defines a template constructor that accepts any
other arbitrary pointer type. (The constructor is defined, it is just
an error to actually try an instantiate it with an inconvertible pointer
type. However, because it is defined, it is still treated as valid for
overload resolution.) Therefore we define a THRIFT_OVERLOAD_IF helper
macro to force overload resolution to occur properly.
Test Plan:
Ran the test code from [fb unittest], although that only tests singleton
factories. I also have an example program that demonstrates using real
processor factories. I'll check that in separately.
Revert Plan:
OK
Conflicts:
lib/cpp/src/Thrift.h
—
lib/cpp/src/Thrift.h | 25 ++++++++
lib/cpp/src/server/TNonblockingServer.h | 66 +++++++++++++++++++--
lib/cpp/src/server/TServer.h | 92 +++++++++++++++++++++++++----
lib/cpp/src/server/TSimpleServer.h | 51 +++++++++++++---
lib/cpp/src/server/TThreadPoolServer.cpp | 22 -------
lib/cpp/src/server/TThreadPoolServer.h | 73 +++++++++++++++++++----
lib/cpp/src/server/TThreadedServer.cpp | 22 ++------
lib/cpp/src/server/TThreadedServer.h | 91 ++++++++++++++++++++++++++---
8 files changed, 351 insertions, 91 deletions
Attachments
Attachments
Issue Links
- is superceded by
-
THRIFT-3130 Remove the last vestiges of THRIFT_OVERLOAD_IF from THRIFT-1316
- Closed
- relates to
-
THRIFT-3083 C++ Consolidate server processing loops in TSimpleServer, TThreadedServer, TThreadPoolServer
- Closed