React Scheduler
The react using messageChannel as a task to run the fiber reconcile, the messageChannel will queue a task.
the microtasks
is the highest prioritied job in event-loop, if the scheduler using microtasks
(like promise), it will block the main-thread since the schduler run the reconcile recursly.
the settimeout and setinterval can’t get the callback immediately even though the second parmater was set to be 0, so there would be a lot of waste betweent the rendering frames.
the is_time_to_rendering
was can not be established, there is no standrad to let the browser followed up, the browser can decides the rendering time by itself(by the screen refresh hertz or someting else), so the requestAnimationFrame
would not be the option nethier.
The setImmediate
, this function is used to break up long running operations and run a callback function immediately after the browser has completed other operations such as events and display updates. it is semantic suite for react scheduler, but it was only implemented in node and old IE.