Files
react-native/ReactCommon/callinvoker/ReactCommon/MessageQueueThreadCallInvoker.cpp
T
Ramanpreet Nara 1b91bfbf63 Introduce MessageQueueThreadCallInvoker
Summary: This abstraction will be used by TurboModules to schedule work on the NativeModules thread.

Reviewed By: PeteTheHeat

Differential Revision: D17422165

fbshipit-source-id: d5ca7837a0ecbcc2118813e1bafa6d445ba2ef3b
2019-09-20 10:52:56 -07:00

23 lines
626 B
C++

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "MessageQueueThreadCallInvoker.h"
namespace facebook {
namespace react {
MessageQueueThreadCallInvoker::MessageQueueThreadCallInvoker(
std::shared_ptr<MessageQueueThread> moduleMessageQueue)
: moduleMessageQueue_(moduleMessageQueue) {}
void MessageQueueThreadCallInvoker::invokeAsync(std::function<void()> &&func) {
moduleMessageQueue_->runOnQueue(std::move(func));
}
} // namespace react
} // namespace facebook