Closed Bug 1832324 Opened 1 year ago Closed 1 year ago

Is it possible to provide a shutdown API for Glean Swift?

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

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: nobody → tlong
Priority: -- → P2
Priority: P2 → P1

: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.

Flags: needinfo?(brizental)

: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.

Flags: needinfo?(brizental)

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!

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: