MCPcopy
hub / github.com/di-sukharev/opencommit / [kDestroy]

Method [kDestroy]

out/cli.cjs:54003–54029  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

54001 return new Promise((resolve) => {
54002 if (!this[kSize]) {
54003 resolve(null);
54004 } else {
54005 this[kClosedResolve] = resolve;
54006 }
54007 });
54008 }
54009 async [kDestroy](err) {
54010 return new Promise((resolve) => {
54011 const requests = this[kQueue].splice(this[kPendingIdx]);
54012 for (let i3 = 0; i3 < requests.length; i3++) {
54013 const request3 = requests[i3];
54014 errorRequest(this, request3, err);
54015 }
54016 const callback = () => {
54017 if (this[kClosedResolve]) {
54018 this[kClosedResolve]();
54019 this[kClosedResolve] = null;
54020 }
54021 resolve();
54022 };
54023 if (this[kHTTP2Session] != null) {
54024 util4.destroy(this[kHTTP2Session], err);
54025 this[kHTTP2Session] = null;
54026 this[kHTTP2SessionState] = null;
54027 }
54028 if (!this[kSocket]) {
54029 queueMicrotask(callback);
54030 } else {
54031 util4.destroy(this[kSocket].on("close", callback), err);
54032 }

Callers

nothing calls this directly

Calls 9

errorRequestFunction · 0.85
resume2Function · 0.85
derefMethod · 0.80
destroyMethod · 0.45
onMethod · 0.45
shiftMethod · 0.45
onErrorMethod · 0.45
valuesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected