SyncExecutorImpl

internal class SyncExecutorImpl(syncStateObserver: SyncStateObserver, slowSyncManager: SlowSyncManager, incrementalSyncManager: IncrementalSyncManager, scope: CoroutineScope, shutdownCoordinator: SyncShutdownCoordinator = SyncShutdownCoordinator(), userScopedLogger: KaliumLogger = kaliumLogger, retryController: SyncRetryController = SyncRetryController()) : SyncExecutor

Constructors

Link copied to clipboard
constructor(syncStateObserver: SyncStateObserver, slowSyncManager: SlowSyncManager, incrementalSyncManager: IncrementalSyncManager, scope: CoroutineScope, shutdownCoordinator: SyncShutdownCoordinator = SyncShutdownCoordinator(), userScopedLogger: KaliumLogger = kaliumLogger, retryController: SyncRetryController = SyncRetryController())

Functions

Link copied to clipboard
open suspend override fun <T> request(requestAction: suspend SyncRequest.() -> T): T

Requests Sync to be performed, fetching new events, etc. bringing the user to an online status. At the end of executorAction, the request is released.

Link copied to clipboard
internal fun resumeExecution()

Lets active and future requests run sync again after any suspension.

Link copied to clipboard
open suspend override fun retryNow()

Reset backoff and wake any scheduled retry. Foreground ownership retains the running sync request.

Link copied to clipboard
open override fun startAndStopSyncAsNeeded()
Link copied to clipboard
open suspend override fun stopForRestart()

Permanently stops sync and waits for in-flight event processing to finish.

Link copied to clipboard
internal suspend fun suspendExecution(): SyncSuspension

Stops sync and returns once it has finished. Sync stays stopped, even for new requests, until resumeExecution; requests stay registered and run again on resume. Cancelling the wait cancels the suspension.