SyncWorker
class SyncWorker @AssistedInject constructor(@Assisted context: Context, @Assisted workerParameters: WorkerParameters, ioDispatcher: CoroutineDispatcher, homeRepository: HomeRepository) : CoroutineWorker(source)
Collects the repository's push-then-pull sync Flow and updates foreground notification counts.
The repository owns persistence and conflict behavior. Completion does not establish that concurrent edits or every remote record were delivered. Exceptions request retry while runAttemptCount is below TOTAL_SYNC_ATTEMPTS; the broad catch includes cancellation.
WorkManager supplies assisted parameters; Hilt supplies the dispatcher and repository.
Parameters
context
Application context provided by WorkManager.
workerParameters
Runtime parameters provided by WorkManager.
ioDispatcher
Dispatcher for sync work.
homeRepository
Repository implementing the sync algorithm.
Constructors
Link copied to clipboard
@AssistedInject