[JS] Extract EventSubmitter interface
The Integration interface is bloated – an implementation will have many different responsibilities. One of those responsibilities is submitting events to the event ingestion service via Integration#enqueueEvent() . Extract this responsibility into the EventSubmitter interface.
Changes
- Extract the
EventSubmitterinterface - Extract the
DefaultEventSubmitterclass from theDefaultIntegrationclass - Create the
BrowserEventSubmitterclass, which batches events and submits them every 5 seconds, or when the page is backgrounded or unloaded-
BrowserEventSubmitterduplicates the logic frommw.eventLogging/BackgroundQueue.js. This is deliberate. It removes our dependency on EventLogging to submit events to the event ingestion service
-
Bug: T366827