Files
react-native/ReactCommon/react/renderer/core/BatchedEventQueue.cpp
T
Samuel Susla ffa533a19d Add option to use unbatched queues only
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
2021-05-22 12:19:05 -07:00

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