Pass SonarState into SonarWebSocketImpl

Summary: Allowing the connection code to update trigger diagnostic events

Reviewed By: danielbuechele

Differential Revision: D9150554

fbshipit-source-id: 5fe0a08edc2f3b0ccae43b4dc2c7b087c6404c58
This commit is contained in:
John Knox
2018-08-07 09:42:13 -07:00
committed by Facebook Github Bot
parent 531a47535b
commit 55ca14ee41
5 changed files with 25 additions and 21 deletions

View File

@@ -10,6 +10,7 @@
#include <Sonar/SonarInitConfig.h>
#include <Sonar/SonarWebSocket.h>
#include <Sonar/SonarState.h>
#include <folly/Executor.h>
#include <folly/io/async/EventBase.h>
#include <rsocket/RSocket.h>
@@ -26,7 +27,7 @@ class SonarWebSocketImpl : public SonarWebSocket {
friend Responder;
public:
SonarWebSocketImpl(SonarInitConfig config);
SonarWebSocketImpl(SonarInitConfig config, std::shared_ptr<SonarState> state);
~SonarWebSocketImpl();
@@ -46,6 +47,7 @@ class SonarWebSocketImpl : public SonarWebSocket {
bool isOpen_ = false;
Callbacks* callbacks_;
DeviceData deviceData_;
std::shared_ptr<SonarState> sonarState_;
folly::EventBase* sonarEventBase_;
folly::EventBase* connectionEventBase_;