MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / acquire

Method acquire

src/pkg/utils/concurrency-control.ts:9–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 }
8
9 async acquire() {
10 if (this.active >= this.limit) {
11 await new Promise<void>((resolve) => this.queue.push(resolve));
12 return;
13 }
14 this.active++;
15 }
16
17 release() {
18 if (this.active > 0) {

Callers 4

taskFunction · 0.80
runFunction · 0.80

Calls 1

pushMethod · 0.80

Tested by 2

taskFunction · 0.64
runFunction · 0.64