Class FlushService

  • All Implemented Interfaces:

    
    public final class FlushService
    
                        
    • Method Detail

      • flushEvents

         final Unit flushEvents(Boolean forAll, Function0<Unit> onComplete)

        Flushes events from the queue.

        This function attempts to send a batch of events to the server. It respects the wifiOnly setting, skipping the flush if the device is not on Wi-Fi and wifiOnly is true. The flushing process is protected by a mutex to ensure serial execution.

        Parameters:
        forAll - If true, attempts to flush all events currently in the queue in batches.
        onComplete - A callback function that will be executed on the main thread after the flush attempt (regardless of success or failure, or if the flush was skipped due to network conditions).