MCPcopy
hub / github.com/vuejs/core / queueJob

Function queueJob

packages/runtime-core/src/scheduler.ts:99–117  ·  view source on GitHub ↗
(job: SchedulerJob)

Source from the content-addressed store, hash-verified

97}
98
99export function queueJob(job: SchedulerJob): void {
100 if (!(job.flags! & SchedulerJobFlags.QUEUED)) {
101 const jobId = getId(job)
102 const lastJob = queue[queue.length - 1]
103 if (
104 !lastJob ||
105 // fast path when the job id is larger than the tail
106 (!(job.flags! & SchedulerJobFlags.PRE) && jobId >= getId(lastJob))
107 ) {
108 queue.push(job)
109 } else {
110 queue.splice(findInsertionIndex(jobId), 0, job)
111 }
112
113 job.flags! |= SchedulerJobFlags.QUEUED
114
115 queueFlush()
116 }
117}
118
119function queueFlush() {
120 if (!currentFlushPromise) {

Callers 9

setupRenderEffectFunction · 0.90
reloadFunction · 0.90
doWatchFunction · 0.90
scheduler.spec.tsFile · 0.90
job1Function · 0.90
job2Function · 0.90
cb1Function · 0.90
jobFunction · 0.90

Calls 4

findInsertionIndexFunction · 0.85
queueFlushFunction · 0.85
getIdFunction · 0.70
pushMethod · 0.65

Tested by 4

job1Function · 0.72
job2Function · 0.72
cb1Function · 0.72
jobFunction · 0.72