Closed evilthreads669966 closed 3 years ago
Thing is...I'm not laughing. At all. And I need to brush my teeth so I don't lose more teeth. I haven't showered in more than 7 days.
Those weird hacker quests you go on to build a bridge made out of eggs and spoons. You know in the end it makes you a lot better but I mean yeah it is faster but the amount of time to pull that off. I've gone on those quests a few too many times.
I have this written incorrect. I mean it could be correect if you wanted to do Flow<List
internal suspend fun rescheduleWorkAfterReboot(scope: CoroutineScope, work: Work?){
dao.getPersistentWork().filterNotNull()
.flatMapMerge(DEFAULT_CONCURRENCY){
flow {
emit(it.map { Worker.createFromWork(it)} )
}
}
.onEach {
if(work != null)
it.find { it.id == work.id }?.let { scheduler.use { (it as PersistentWorker).scheduleFuture() } }
else
it.filterIsInstance<PersistentWorker>()
.forEach { worker -> scheduler.use { worker.scheduleFuture() } }
}.flowOn(Dispatchers.Default)
.launchIn(scope)
}
I'm laying in bed like just finishing writing that function and I check my git log and it goes back like 30 merges haha. Wow. I've never felt like this bad before. Like right as my body begins to feel weary and my eyes are burning from the excessive screen exposure and lack off sleep...i guess it feels better though because the end result. makes my eyes lay easier