SensingEngine.syncUpload is moved to SensingSynchronizer.synchornize API
in synchronize we
Fetch all upload requests
invoke upload on them
Collect individual UploadResults and creatSyncUploadStates
We start off with emitting SyncUploadState.Started.
Then the states are SyncUploadState.InProgress for all individual UploadResults statuses except for Failed state. Here we emit SyncUploadState.Failed and the worker cancels the upload job.
Finally we emit SyncUploadState.Completed
We also added SyncUploadState.NoOp for the case when a new worker attempts to sync when there is already one worker which is running.
These SyncUploadStatees are collected by worker and persisted as WorkManager's progress data using setProgress API. This progress can be fetched as a flow using
Fixes #47
SensingEngine.syncUpload
is moved toSensingSynchronizer.synchornize
APIin synchronize we
UploadResult
s and creatSyncUploadState
s We start off with emittingSyncUploadState.Started
. Then the states areSyncUploadState.InProgress
for all individualUploadResult
s statuses except for Failed state. Here we emitSyncUploadState.Failed
and the worker cancels the upload job. Finally we emitSyncUploadState.Completed
We also added
SyncUploadState.NoOp
for the case when a new worker attempts to sync when there is already one worker which is running.These
SyncUploadState
es are collected by worker and persisted as WorkManager's progress data usingsetProgress
API. This progress can be fetched as a flow usingTESTED with code in demo app: Sensory. Look at the following progress bar.