mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
31 lines
651 B
C++
31 lines
651 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.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/renderer/core/EventQueue.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Event Queue that dispatches event in batches synchronizing them with
|
|
* an Event Beat.
|
|
*/
|
|
class BatchedEventQueue final : public EventQueue {
|
|
public:
|
|
BatchedEventQueue(
|
|
EventPipe eventPipe,
|
|
StatePipe statePipe,
|
|
std::unique_ptr<EventBeat> eventBeat);
|
|
|
|
void onEnqueue() const override;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|