MCPcopy
hub / github.com/yarnpkg/yarn / push

Method push

src/util/blocking-queue.js:64–80  ·  view source on GitHub ↗
(key: string, factory: () => Promise<T>)

Source from the content-addressed store, hash-verified

62 }
63
64 push<T>(key: string, factory: () => Promise<T>): Promise<T> {
65 if (this.first) {
66 this.first = false;
67 } else {
68 this.stillActive();
69 }
70
71 return new Promise((resolve, reject) => {
72 // we're already running so push ourselves to the queue
73 const queue = (this.queue[key] = this.queue[key] || []);
74 queue.push({factory, resolve, reject});
75
76 if (!this.running[key]) {
77 this.shift(key);
78 }
79 });
80 }
81
82 shift(key: string) {
83 if (this.running[key]) {

Callers 15

fs.jsFile · 0.80
addLocationMethod · 0.80
addRequestMethod · 0.80
addPatternMethod · 0.80
dedupePatternsMethod · 0.80
addMethod · 0.80
getAllInfoForPatternsMethod · 0.80
getManifestsMethod · 0.80
addPatternMethod · 0.80
resolveToResolutionMethod · 0.80

Calls 2

stillActiveMethod · 0.95
shiftMethod · 0.95

Tested by 2

requestFunction · 0.64
createFunction · 0.64