streaming: Make stream_session::_handlers static

It is used to register the streaming message handler once. We don't need
it in every stream_session instance. The side effect is making
stream_session copyable, which is needed in get_all_stream_sessions.
This commit is contained in:
Asias He
2015-06-26 09:37:58 +08:00
parent ec8a0e2566
commit 9cbed3e4e1
2 changed files with 3 additions and 1 deletions

View File

@@ -86,6 +86,8 @@ void stream_session::init_messaging_service_handler() {
});
}
distributed<stream_session::handler> stream_session::_handlers;
future<> stream_session::start() {
return _handlers.start().then([this] {
return _handlers.invoke_on_all([this] (handler& h) {

View File

@@ -123,7 +123,7 @@ private:
return make_ready_future<>();
}
};
distributed<handler> _handlers;
static distributed<handler> _handlers;
void init_messaging_service_handler();
future<> start();
public: