evilthreads669966 / BootLaces

A Kotlin work manager library for Android with progress notifications and Hilt support.
Apache License 2.0
34 stars 4 forks source link

HAHAHA #193

Closed evilthreads669966 closed 3 years ago

evilthreads669966 commented 3 years ago

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

evilthreads669966 commented 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.

evilthreads669966 commented 3 years ago

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.

evilthreads669966 commented 3 years ago

I have this written incorrect. I mean it could be correect if you wanted to do Flow<List> to Flow<List> but I want ti to do Flow<List> and then it gives you T over and over in onEach How the heck am I supposed to talk about code if I cant you double nested generics and github sensors them

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)
    }