THRIFT-928. cpp: Make clients call writeEnd on their transports before flush
Changing the order of these calls makes more sense from the perspective
of logical operations. It also simplifies the upcoming stats collection
code. No clients should be affected.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005128 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/async/TAsyncProcessor.h b/lib/cpp/src/async/TAsyncProcessor.h
index abf5816..a0b5428 100644
--- a/lib/cpp/src/async/TAsyncProcessor.h
+++ b/lib/cpp/src/async/TAsyncProcessor.h
@@ -31,6 +31,9 @@
* Async version of a TProcessor. It is not expected to complete by the time
* the call to process returns. Instead, it calls a cob to signal completion.
*/
+
+class TEventServer; // forward declaration
+
class TAsyncProcessor {
public:
virtual ~TAsyncProcessor() {}
@@ -44,8 +47,27 @@
return process(_return, io, io);
}
+ boost::shared_ptr<TProcessorEventHandler> getEventHandler() {
+ return eventHandler_;
+ }
+
+ void setEventHandler(boost::shared_ptr<TProcessorEventHandler> eventHandler) {
+ eventHandler_ = eventHandler;
+ }
+
+ const TEventServer* getAsyncServer() {
+ return asyncServer_;
+ }
protected:
TAsyncProcessor() {}
+
+ boost::shared_ptr<TProcessorEventHandler> eventHandler_;
+ const TEventServer* asyncServer_;
+ private:
+ friend class TEventServer;
+ void setAsyncServer(const TEventServer* server) {
+ asyncServer_ = server;
+ }
};
}}} // apache::thrift::async