-
public final class FlushWorkerWatches for connectivity changes and flushes any cached requests using the provided networkExecutor. Caches requests using JSON Lines format.
-
-
Constructor Summary
Constructors Constructor Description FlushWorker(Context context, SuspendFunction3<String, String, String, String> networkExecutor)
-
Method Summary
Modifier and Type Method Description final Unitstart()Start listening and attempt an immediate flush on init. final Unitstop()Stop the periodic flush timer. final UnitcacheRequest(CachedRequest req)Append a failed request to the cache file as a single JSON line. -
-
Method Detail
-
start
@RequiresPermission(value = android.permission.ACCESS_NETWORK_STATE) final Unit start()
Start listening and attempt an immediate flush on init.
-
cacheRequest
final Unit cacheRequest(CachedRequest req)
Append a failed request to the cache file as a single JSON line.
-
-
-
-