Partially remove dependency on folly async
Summary: This change isolates the usage of folly async from Flipper. Is now self-contained in Flipper Folly schedulers. Users of Flipper can decide not to use the types defined in that header and implement their own. NOTE: changes are minimal, we are just replacing direct calls to folly event base with a scheduler which simply relays this on to folly. Reviewed By: fabiomassimo Differential Revision: D36052198 fbshipit-source-id: 170d64a324a1f1f100224e2622a59cbac3c8b642
This commit is contained in:
committed by
Facebook GitHub Bot
parent
216c926ca5
commit
ade685c621
@@ -14,8 +14,6 @@
|
||||
#include <Flipper/Log.h>
|
||||
#include <folly/String.h>
|
||||
#include <folly/futures/Future.h>
|
||||
#include <folly/io/async/AsyncSocketException.h>
|
||||
#include <folly/io/async/SSLContext.h>
|
||||
#include <folly/json.h>
|
||||
#include <cctype>
|
||||
#include <iomanip>
|
||||
@@ -32,24 +30,24 @@ namespace flipper {
|
||||
FlipperWebSocket::FlipperWebSocket(
|
||||
FlipperConnectionEndpoint endpoint,
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload,
|
||||
folly::EventBase* eventBase)
|
||||
Scheduler* scheduler)
|
||||
: FlipperWebSocket(
|
||||
std::move(endpoint),
|
||||
std::move(payload),
|
||||
eventBase,
|
||||
scheduler,
|
||||
nullptr) {}
|
||||
|
||||
FlipperWebSocket::FlipperWebSocket(
|
||||
FlipperConnectionEndpoint endpoint,
|
||||
std::unique_ptr<FlipperSocketBasePayload> payload,
|
||||
folly::EventBase* eventBase,
|
||||
Scheduler* scheduler,
|
||||
ConnectionContextStore* connectionContextStore) {
|
||||
if (endpoint.secure) {
|
||||
socket_ = std::make_unique<WebSocketTLSClient>(
|
||||
endpoint, std::move(payload), eventBase, connectionContextStore);
|
||||
endpoint, std::move(payload), scheduler, connectionContextStore);
|
||||
} else {
|
||||
socket_ = std::make_unique<WebSocketClient>(
|
||||
endpoint, std::move(payload), eventBase, connectionContextStore);
|
||||
endpoint, std::move(payload), scheduler, connectionContextStore);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user