mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ffa533a19d
Summary: Changelog: [internal] My suggestion is to simplify event dispatching to only two options, synchronous and asynchronous. Why? - Fabric has only been using one queue, `AsynchronousBatched`. - Batching happens even on `AsynchronousUnbatched`. It just batches events until JS thread starts processing them instead of waiting for the main run loop. - It will make it easier to reason about the code in the future once we start utilising different priorities for Concurrent Mode. Reviewed By: JoshuaGross Differential Revision: D28603472 fbshipit-source-id: 14e3a9c15a012c550dc16a044c31d722051a2bdc
24 lines
572 B
C++
24 lines
572 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 "BatchedEventQueue.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
BatchedEventQueue::BatchedEventQueue(
|
|
EventPipe eventPipe,
|
|
StatePipe statePipe,
|
|
std::unique_ptr<EventBeat> eventBeat)
|
|
: EventQueue(eventPipe, statePipe, std::move(eventBeat)) {}
|
|
|
|
void BatchedEventQueue::onEnqueue() const {
|
|
eventBeat_->request();
|
|
}
|
|
} // namespace react
|
|
} // namespace facebook
|