mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
Batch messages on the exthost to not freeze ads (#8949)
* batch messages on the exthost to not freeze ads * clear out messages on query complete
This commit is contained in:
@@ -62,3 +62,26 @@ export class ReverseLookUpMap<K, V> {
|
||||
return this.forward.size;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ASSUMES THAT THE VALUES ARE ALREADY SERIALIZABLE
|
||||
*/
|
||||
export function mapToSerializable<T>(map: Map<string, T>): [string, T][] {
|
||||
const serializable: [string, T][] = [];
|
||||
|
||||
map.forEach((value, key) => {
|
||||
serializable.push([key, value]);
|
||||
});
|
||||
|
||||
return serializable;
|
||||
}
|
||||
|
||||
export function serializableToMap<T>(serializable: [string, T][]): Map<string, T> {
|
||||
const items = new Map<string, T>();
|
||||
|
||||
for (const [key, value] of serializable) {
|
||||
items.set(key, value);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user