MCPcopy Create free account
hub / github.com/Snapchat/Valdi / DeferredContainer

Class DeferredContainer

valdi/vscode_debugger/src/adapter/threads.ts:99–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97};
98
99class DeferredContainer<T> {
100 private _dapDeferred: IDeferred<T> = getDeferred();
101
102 constructor(private readonly _obj: T) {}
103
104 resolve(): void {
105 this._dapDeferred.resolve(this._obj);
106 }
107
108 with<Return>(callback: (obj: T) => Return): Return | Promise<Return> {
109 if (this._dapDeferred.hasSettled()) {
110 return callback(this._obj);
111 } else {
112 return this._dapDeferred.promise.then(obj => callback(obj));
113 }
114 }
115}
116
117export class Thread implements IVariableStoreDelegate {
118 private static _lastThreadId = 0;

Callers

nothing calls this directly

Calls 1

getDeferredFunction · 0.90

Tested by

no test coverage detected