Skip to content

Commit d79f658

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Rename RuntimeScheduler::callImmediates to RuntimeScheduelr::callExpiredTasks
Summary: changelog: [internal] Rename method so it does not collide with immediates that already exist in React Native. Reviewed By: javache Differential Revision: D34041418 fbshipit-source-id: 0ae75b683983c3be50320b195a7068d7178b0ed8
1 parent b0bae21 commit d79f658

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void RuntimeScheduler::executeNowOnTheSameThread(
9292
scheduleWorkLoopIfNecessary();
9393
}
9494

95-
void RuntimeScheduler::callImmediates(jsi::Runtime &runtime) {
95+
void RuntimeScheduler::callExpiredTasks(jsi::Runtime &runtime) {
9696
auto previousPriority = currentPriority_;
9797
try {
9898
while (!taskQueue_.empty()) {

ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,14 @@ class RuntimeScheduler final {
9797
RuntimeSchedulerTimePoint now() const noexcept;
9898

9999
/*
100-
* Immediate is a task that is expired and should have been already executed
101-
* or has priority set to Immediate. Designed to be called in the event
102-
* pipeline after an event is dispatched to React. React may schedule events
103-
* with immediate priority which need to be handled before the next event is
104-
* sent to React.
100+
* Expired task is a task that should have been already executed. Designed to
101+
* be called in the event pipeline after an event is dispatched to React.
102+
* React may schedule events with immediate priority which need to be handled
103+
* before the next event is sent to React.
105104
*
106105
* Thread synchronization must be enforced externally.
107106
*/
108-
void callImmediates(jsi::Runtime &runtime);
107+
void callExpiredTasks(jsi::Runtime &runtime);
109108
void setEnableYielding(bool enableYielding);
110109

111110
private:

ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ TEST_F(RuntimeSchedulerTest, sameThreadTaskCreatesImmediatePriorityTask) {
532532
runtimeScheduler_->scheduleTask(
533533
SchedulerPriority::ImmediatePriority, std::move(callback));
534534

535-
runtimeScheduler_->callImmediates(runtime);
535+
runtimeScheduler_->callExpiredTasks(runtime);
536536
});
537537
});
538538

@@ -569,7 +569,7 @@ TEST_F(RuntimeSchedulerTest, sameThreadTaskCreatesLowPriorityTask) {
569569

570570
runtimeScheduler_->scheduleTask(
571571
SchedulerPriority::LowPriority, std::move(callback));
572-
runtimeScheduler_->callImmediates(runtime);
572+
runtimeScheduler_->callExpiredTasks(runtime);
573573

574574
EXPECT_FALSE(didRunSubsequentTask);
575575
});

ReactCommon/react/renderer/scheduler/Scheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Scheduler::Scheduler(
7979
},
8080
runtime);
8181
if (runtimeScheduler) {
82-
runtimeScheduler->callImmediates(runtime);
82+
runtimeScheduler->callExpiredTasks(runtime);
8383
}
8484
};
8585

0 commit comments

Comments
 (0)