From f8c79b55dc5612da5be73315d12f7dd5f265d80b Mon Sep 17 00:00:00 2001 From: John Knox Date: Thu, 28 Jun 2018 04:26:26 -0700 Subject: [PATCH] Back out "[sonar] Stop using folly Future::delayedUnsafe()" Summary: Original commit changeset: 51ab3224b93e Reviewed By: priteshrnandgaonkar Differential Revision: D8676855 fbshipit-source-id: 38282f642d8497ce7715017127368445132454fa --- xplat/Sonar/SonarWebSocketImpl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xplat/Sonar/SonarWebSocketImpl.cpp b/xplat/Sonar/SonarWebSocketImpl.cpp index eea0aeb90..343aa7956 100644 --- a/xplat/Sonar/SonarWebSocketImpl.cpp +++ b/xplat/Sonar/SonarWebSocketImpl.cpp @@ -8,7 +8,6 @@ #include "SonarWebSocketImpl.h" #include -#include #include #include #include @@ -93,14 +92,15 @@ class Responder : public rsocket::RSocketResponder { SonarWebSocketImpl::SonarWebSocketImpl(SonarInitConfig config) : deviceData_(config.deviceData), worker_(config.worker) {} -folly::IOExecutor* ioExecutor; - SonarWebSocketImpl::~SonarWebSocketImpl() { stop(); } void SonarWebSocketImpl::start() { - folly::makeFuture().via(ioExecutor).then([this]() { startSync(); }); + folly::makeFuture() + .via(worker_->getEventBase()) + .delayedUnsafe(std::chrono::milliseconds(0)) + .then([this]() { startSync(); }); } void SonarWebSocketImpl::startSync() { @@ -184,8 +184,8 @@ void SonarWebSocketImpl::connectSecurely() { void SonarWebSocketImpl::reconnect() { folly::makeFuture() - .via(ioExecutor) - .delayed(std::chrono::seconds(reconnectIntervalSeconds)) + .via(worker_->getEventBase()) + .delayedUnsafe(std::chrono::seconds(reconnectIntervalSeconds)) .then([this]() { startSync(); }); }