Skip to content

Commit 8ffe9ef

Browse files
committed
Export shutdown API to consumers
1 parent 994ca03 commit 8ffe9ef

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

glean/src/index/qt.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,15 @@ function setSourceTags(value) {
9191
Glean.Glean.default.setSourceTags(value);
9292
}
9393

94+
/**
95+
* Finishes executing any ongoing tasks and shutsdown Glean.
96+
*
97+
* This will attempt to send pending pings before resolving.
98+
*
99+
* @returns A promise which resolves once shutdown is complete.
100+
*/
101+
function shutdown() {
102+
return Glean.shutdown();
103+
}
104+
94105
const _private = Glean.Glean.default._private;

glean/src/index/qt.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ export default {
101101
Glean.setSourceTags(value);
102102
},
103103

104+
/**
105+
* Finishes executing any ongoing tasks and shutsdown Glean.
106+
*
107+
* This will attempt to send pending pings before resolving.
108+
*
109+
* @returns A promise which resolves once shutdown is complete.
110+
*/
111+
shutdown(): Promise<void> {
112+
return Glean.shutdown();
113+
},
114+
104115
ErrorType,
105116

106117
_private: {

glean/src/index/webext.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ export default {
7373
Glean.setDebugViewTag(value);
7474
},
7575

76+
/**
77+
* Finishes executing any ongoing tasks and shutsdown Glean.
78+
*
79+
* This will attempt to send pending pings before resolving.
80+
*
81+
* @returns A promise which resolves once shutdown is complete.
82+
*/
83+
shutdown(): Promise<void> {
84+
return Glean.shutdown();
85+
},
86+
7687
/**
7788
* Sets the `sourceTags` debug option.
7889
*

0 commit comments

Comments
 (0)