mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
23 lines
626 B
C++
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
|