MCPcopy Create free account
hub / github.com/denodrivers/postgres / pop

Method pop

utils/deferred.ts:22–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 }
21
22 async pop(): Promise<T> {
23 if (this.#elements.length > 0) {
24 return this.#elements.pop()!;
25 }
26
27 if (this.#size < this.#max_size && this.#creator) {
28 this.#size++;
29 return await this.#creator();
30 }
31 const d = Promise.withResolvers<T>();
32 this.#queue.push(d);
33 return await d.promise;
34 }
35
36 push(value: T): void {
37 if (this.#queue.length > 0) {

Callers 5

connectMethod · 0.45
endMethod · 0.45
queryMethod · 0.45
popMethod · 0.45
utils_test.tsFile · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected