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

Method stop

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

Source from the content-addressed store, hash-verified

183 }
184
185 stop() {
186 if (this.#promise) {
187 return this.#promise;
188 }
189 const stopTaker = this.#worker[kHandle]?.stopHeapProfile();
190 return this.#promise = new Promise((resolve, reject) => {
191 if (!stopTaker) return reject(new ERR_WORKER_NOT_RUNNING());
192 stopTaker.ondone = (err, profile) => {
193 if (err) {
194 return reject(err);
195 }
196 resolve(profile);
197 };
198 });
199 };
200
201 async [SymbolAsyncDispose]() {
202 await this.stop();

Callers 1

[SymbolAsyncDispose]Method · 0.95

Calls 2

rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected