Is it possible to provide a shutdown API for Glean Swift?
Categories
(Data Platform and Tools :: Glean: SDK, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: brizental, Assigned: travis_)
Details
Attachments
(1 file)
The VPN is adding Glean to the Network Extension of our app, which is a separate process that is started when the VPN is connect and ended when it's disconnected. I would love to add a shutdown call to attempt to send any remaining pings before ending the connection. Is that API possible on Swift?
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
:brizental, are you looking for something that will flush any pending pings and then block waiting for the upload? I'm looking at ways we could do this and I'd appreciate if you could provide a little more detail on exactly what you would expect the API to do for you.
Reporter | ||
Comment 2•1 year ago
|
||
:brizental, are you looking for something that will flush any pending pings and then block waiting for the upload? I'm looking at ways we could do this and I'd appreciate if you could provide a little more detail on exactly what you would expect the API to do for you.
Sure. We are now running an instance of Glean on the VPN's network extension. That is a process that starts whenever the VPN is turned on and is destroyed whenever it's turned off,. If I try to submit a ping upon turning off the VPN, the ping ends up not even getting enqueued. I am not sure we need to block on upload, would the uploader service keep running until upload is done? If so that is not necessary, but at least enqueueing the pings needs to complete.
Assignee | ||
Comment 3•1 year ago
|
||
So if you just need to submit the ping and then await the dispatcher to complete queuing it, and do not need to trigger the uploader, I think we can provide a function that just waits for the dispatcher tasks to drain. Let me tinker around with this and see what I can come up with.
Thanks for the extra info!
Comment 4•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Description
•