MCPcopy
hub / github.com/facebook/react / pingTask

Function pingTask

packages/react-server/src/ReactFlightServer.js:2536–2554  ·  view source on GitHub ↗
(request: Request, task: Task)

Source from the content-addressed store, hash-verified

2534}
2535
2536function pingTask(request: Request, task: Task): void {
2537 if (
2538 enableProfilerTimer &&
2539 (enableComponentPerformanceTrack || enableAsyncDebugInfo)
2540 ) {
2541 // If this was async we need to emit the time when it completes.
2542 task.timed = true;
2543 }
2544 const pingedTasks = request.pingedTasks;
2545 pingedTasks.push(task);
2546 if (pingedTasks.length === 1) {
2547 request.flushScheduled = request.destination !== null;
2548 if (request.type === PRERENDER || request.status === OPENING) {
2549 scheduleMicrotask(() => performWork(request));
2550 } else {
2551 scheduleWork(() => performWork(request));
2552 }
2553 }
2554}
2555
2556function createTask(
2557 request: Request,

Callers 4

serializeThenableFunction · 0.70
deferTaskFunction · 0.70
createTaskFunction · 0.70
progressFunction · 0.70

Calls 4

scheduleMicrotaskFunction · 0.90
scheduleWorkFunction · 0.90
performWorkFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected