MCPcopy Index your code
hub / github.com/nodejs/node / stop

Method stop

lib/internal/worker.js:156–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154 }
155
156 stop() {
157 if (this.#promise) {
158 return this.#promise;
159 }
160 const stopTaker = this.#worker[kHandle]?.stopCpuProfile(this.#id);
161 return this.#promise = new Promise((resolve, reject) => {
162 if (!stopTaker) return reject(new ERR_WORKER_NOT_RUNNING());
163 stopTaker.ondone = (err, profile) => {
164 if (err) {
165 return reject(err);
166 }
167 resolve(profile);
168 };
169 });
170 };
171
172 async [SymbolAsyncDispose]() {
173 await this.stop();

Callers 1

[SymbolAsyncDispose]Method · 0.95

Calls 2

rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected