MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / disposeImpl

Function disposeImpl

src/kernels/kernel.ts:336–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334 this._ignoreJupyterSessionDisposedErrors = true;
335 this.startCancellation.cancel();
336 const disposeImpl = async () => {
337 const promises: Promise<void>[] = [];
338 promises.push(
339 Promise.all(Array.from(this.hooks.get('willCancel') || new Set<Hook>()).map((h) => h()))
340 .then(noop)
341 .catch(noop)
342 );
343 this._session = this._session
344 ? this._session
345 : this._jupyterSessionPromise
346 ? await this._jupyterSessionPromise.catch(() => undefined)
347 : undefined;
348 this._jupyterSessionPromise = undefined;
349 this._postInitializedOnStartPromise = undefined;
350 if (this._session) {
351 promises.push(disposeAsync(this._session, this.disposables));
352 this._session = undefined;
353 }
354 this._disposed = true;
355 this._onDisposed.fire();
356 this._onStatusChanged.fire('dead');
357 try {
358 await Promise.all(promises);
359 } finally {
360 this.startCancellation.dispose();
361 dispose(this.disposables);
362 }
363 };
364 this.disposingPromise = disposeImpl();
365 await this.disposingPromise;
366 }

Callers 1

disposeFunction · 0.85

Calls 9

disposeAsyncFunction · 0.90
disposeFunction · 0.90
mapMethod · 0.80
pushMethod · 0.65
getMethod · 0.65
disposeMethod · 0.65
allMethod · 0.45
fromMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected