SyncManager

open class SyncManager

Uploads the queue of unsent packages (UnsentData).

Every pass runs on ONE worker thread, so passes never overlap: an item is read, posted and deleted by one pass before the next pass reads the queue (no double upload). Triggers (#312, ruling W10): SDK start (start), the network coming back (debounced), a newly queued package, and the in-session backoff retry. Triggers that arrive while a flush is already waiting to run are coalesced into it, so a burst of triggers costs at most one extra pass.

Constructors

Link copied to clipboard
constructor(@NonNull connectivityManager: ConnectivityManager)

Types

Link copied to clipboard
interface Listener

Functions

Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
open fun requestSync(@NonNull webApiClient: WebApiClient, @NonNull mapstedDb: MapstedDb)
open fun requestSync(@NonNull webApiClient: WebApiClient, @NonNull mapstedDb: MapstedDb, @Nullable listener: SyncManager.Listener)
Link copied to clipboard
open fun start(@NonNull webApiClient: WebApiClient, @NonNull mapstedDb: MapstedDb)
W10 (#312): flush whatever is queued now (SDK start; no new package is needed) and again each time a network becomes available.