[ 
https://issues.apache.org/jira/browse/THRIFT-3083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14521329#comment-14521329
 ] 

Hudson commented on THRIFT-3083:
--------------------------------

SUCCESS: Integrated in Thrift #1523 (See 
[https://builds.apache.org/job/Thrift/1523/])
THRIFT-3083 consolidate simple and threaded server run loops (roger: rev 
21b68524084cb47ada51701aa13061d8820d15e5)
* lib/cpp/src/thrift/server/TSimpleServer.cpp
* lib/cpp/src/thrift/server/TServerFramework.cpp
* lib/cpp/Makefile.am
* lib/cpp/src/thrift/server/TThreadedServer.cpp
* lib/cpp/src/thrift/server/TConnectedClient.cpp
* lib/cpp/src/thrift/server/TServerFramework.h
* lib/cpp/src/thrift/server/TConnectedClient.h
* lib/cpp/src/thrift/server/TThreadedServer.h
* lib/cpp/CMakeLists.txt
* lib/cpp/src/thrift/server/TThreadPoolServer.h
* lib/cpp/src/thrift/server/TThreadPoolServer.cpp
* lib/cpp/src/thrift/server/TSimpleServer.h


> C++ Consolidate server processing loops in TSimpleServer, TThreadedServer, 
> TThreadPoolServer
> --------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3083
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3083
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8, 0.9, 0.9.1, 0.9.2
>            Reporter: James E. King, III
>             Fix For: 0.9.3
>
>         Attachments: THRIFT-3083-server-files.tar, THRIFT-3083.patch
>
>
> Currently the simple and threaded servers all share a very similar serve() 
> workflow.  This improvement story is to consolidate them and extract out the 
> specific differences to limit code duplication.
> 1. Add TServerFramework that implements serve() and stop() for TServer, but 
> is abstract.
> 2. Add virtual methods onClientConnected, onClientDisconnected to 
> TServerFramework and require subclasses to implement them.
> 3. TSimpleServer onClientConnected calls TConnectedClient().run() in the 
> serve() thread, thus blocking the server thread until the client disconnects.
> 4. TThreadedServer::serve() calls TServerFramework::serve() and then waits 
> for the notification that all clients are gone.  ::onClientConnected adds a 
> TConnectedClient to the task set and starts a thread for it.  
> ::onClientDisconnected removes the client from the task set.
> 5. TThreadPoolServer would have similar changes.
> The resulting classes will be much smaller, and the specific differences 
> between the servers will be more obvious.  Further, the server processing 
> loop which is common to all three will be in one place.  This improves the 
> predictability of thrift and helps improve maintainability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to