diff --git a/erizoAPI/FuturesManager.cc b/erizoAPI/FuturesManager.cc deleted file mode 100644 index 632c57efbd..0000000000 --- a/erizoAPI/FuturesManager.cc +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef BUILDING_NODE_EXTENSION -#define BUILDING_NODE_EXTENSION -#endif -#include "FuturesManager.h" - -DEFINE_LOGGER(FuturesManager, "ErizoAPI.FuturesManager"); - -FuturesManager::FuturesManager() { -} - -FuturesManager::~FuturesManager() { -} - -void FuturesManager::add(boost::future future) { - futures.push_back(std::move(future)); -} - -void FuturesManager::cleanResolvedFutures() { - futures.erase(std::remove_if(futures.begin(), futures.end(), - [](const boost::future& future) { - return future.is_ready(); - }), futures.end()); - ELOG_DEBUG("message: futures after removing resolved, size: %d", numberOfUnresolvedFutures()); -} - -int FuturesManager::numberOfUnresolvedFutures() { - return futures.size(); -} diff --git a/erizoAPI/FuturesManager.h b/erizoAPI/FuturesManager.h deleted file mode 100644 index 8c8688444d..0000000000 --- a/erizoAPI/FuturesManager.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ERIZOAPI_FUTURESMANAGER_H_ -#define ERIZOAPI_FUTURESMANAGER_H_ - -#include -#include -#include // NOLINT - -/* - * Wrapper class of erizo::ExternalInput - * - * Represents a OneToMany connection. - * Receives media from one publisher and retransmits it to every subscriber. - */ -class FuturesManager { - public: - DECLARE_LOGGER(); - FuturesManager(); - ~FuturesManager(); - void add(boost::future future); - void cleanResolvedFutures(); - int numberOfUnresolvedFutures(); - - private: - std::vector> futures; -}; - -#endif // ERIZOAPI_FUTURESMANAGER_H_ diff --git a/erizoAPI/MediaStream.cc b/erizoAPI/MediaStream.cc index f3ff2bafd4..68789a071b 100644 --- a/erizoAPI/MediaStream.cc +++ b/erizoAPI/MediaStream.cc @@ -545,7 +545,6 @@ NAUV_WORK_CB(MediaStream::closePromiseResolver) { } boost::mutex::scoped_lock lock(obj->mutex); ELOG_DEBUG("%s, message: closePromiseResolver", obj->toLog()); - obj->futures_manager_.cleanResolvedFutures(); obj->Ref(); while (!obj->futures.empty()) { auto persistent = obj->futures.front(); diff --git a/erizoAPI/MediaStream.h b/erizoAPI/MediaStream.h index b35c30b032..a6f40b147d 100644 --- a/erizoAPI/MediaStream.h +++ b/erizoAPI/MediaStream.h @@ -5,7 +5,6 @@ #include #include #include -#include "FuturesManager.h" #include "MediaDefinitions.h" #include "OneToManyProcessor.h" @@ -41,8 +40,6 @@ class MediaStream : public MediaSink, public erizo::MediaStreamStatsListener, pu std::queue stats_messages; std::queue> event_messages; std::queue *> futures; - FuturesManager futures_manager_; - boost::mutex mutex; private: diff --git a/erizoAPI/WebRtcConnection.cc b/erizoAPI/WebRtcConnection.cc index 6e547ce47e..994cccf21f 100644 --- a/erizoAPI/WebRtcConnection.cc +++ b/erizoAPI/WebRtcConnection.cc @@ -578,7 +578,6 @@ NAUV_WORK_CB(WebRtcConnection::promiseResolver) { } boost::mutex::scoped_lock lock(obj->mutex); ELOG_DEBUG("%s, message: promiseResolver", obj->toLog()); - obj->futures_manager_.cleanResolvedFutures(); while (!obj->futures.empty()) { auto persistent = obj->futures.front().first; v8::Local resolver = Nan::New(*persistent); diff --git a/erizoAPI/WebRtcConnection.h b/erizoAPI/WebRtcConnection.h index 96eb3e4b9c..a1864be4bb 100644 --- a/erizoAPI/WebRtcConnection.h +++ b/erizoAPI/WebRtcConnection.h @@ -5,7 +5,6 @@ #include #include #include -#include "FuturesManager.h" #include "MediaDefinitions.h" #include "OneToManyProcessor.h" #include "ConnectionDescription.h" @@ -46,7 +45,6 @@ class WebRtcConnection : public erizo::WebRtcConnectionEventListener, std::queue event_status; std::queue event_messages; std::queue futures; - FuturesManager futures_manager_; boost::mutex mutex; diff --git a/erizoAPI/binding.gyp b/erizoAPI/binding.gyp index ac9e43b0d6..94ec9fae80 100644 --- a/erizoAPI/binding.gyp +++ b/erizoAPI/binding.gyp @@ -1,6 +1,6 @@ { 'variables' : { - 'common_sources': [ 'addon.cc', 'IOThreadPool.cc', 'AsyncPromiseWorker.cc', 'FuturesManager.cc', 'ThreadPool.cc', 'MediaStream.cc', 'WebRtcConnection.cc', 'OneToManyProcessor.cc', 'ExternalInput.cc', 'ExternalOutput.cc', 'SyntheticInput.cc', 'ConnectionDescription.cc'], + 'common_sources': [ 'addon.cc', 'IOThreadPool.cc', 'AsyncPromiseWorker.cc', 'ThreadPool.cc', 'MediaStream.cc', 'WebRtcConnection.cc', 'OneToManyProcessor.cc', 'ExternalInput.cc', 'ExternalOutput.cc', 'SyntheticInput.cc', 'ConnectionDescription.cc'], 'common_include_dirs' : ["