Snappy/AsyncShutdown

From MozillaWiki
Jump to navigation Jump to search

Our objective

At the moment, Firefox shuts down mostly sequentially. Waiting until an asynchronous task is complete before proceeding with shutdown is complicated and requires spinning the event loop, which is generally Not a Good Idea.

We need to start thinking about a way to shutdown asynchronous services.

Use cases

Asynchronous databases need to be AsyncClosed()

(TBD)

Telemetry data must be saved asynchronously

(TBD)

Related bugs

- https://bugzilla.mozilla.org/show_bug.cgi?id=722648 - Asynchronous observers. - https://bugzilla.mozilla.org/show_bug.cgi?id=881667 - Expose startup/shutdown stage to components.