Package 

Class FlushWorker


  • 
    public final class FlushWorker
    
                        

    Watches for connectivity changes and flushes any cached requests using the provided networkExecutor.

    • Method Summary

      Modifier and Type Method Description
      final Unit start() Start listening and attempt an immediate flush on init.
      final Unit stop() Stop the periodic flush timer.
      final Unit cacheRequest(CachedRequest req) Append a failed request to disk.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlushWorker

        FlushWorker(Context context, SuspendFunction3<String, String, String, String> networkExecutor)
        Parameters:
        context - application context
        networkExecutor - a suspend func taking (method, route, jsonData) -> responseString?