elizarov
10/18/2017, 1:06 PMuli
10/18/2017, 2:05 PMdave08
10/18/2017, 2:06 PMuli
10/18/2017, 2:19 PMdave08
10/18/2017, 2:21 PMval syncRequestChannel = Channel<SyncRequest>(Channel.CONFLATED)
val syncStarterJob by lazy {
launchSyncStarter(syncRequestChannel)
}
fun launchSyncStarter(syncRequestChannel: ReceiveChannel<SyncRequest>) = launch(CommonPool) {
syncRequestChannel.consumeEach { with(it) {
// Sync instructions
} }
}
override fun onSyncStart(context: Context, currSyncResult: SyncResult) {
runBlocking { syncRequestChannel.send(Unit) }
}
uli
10/18/2017, 3:51 PMdave08
10/18/2017, 4:06 PMuli
10/18/2017, 4:07 PMSyncHandler
?dave08
10/18/2017, 4:09 PMuli
10/18/2017, 4:21 PMSyncHandler
interface