Harun
02/09/2019, 3:30 PMfrellan
02/09/2019, 4:05 PMobject
that does stuff and writes to a status object that I can then read to know the state of the job (like how many items are processed etc). This is obviously crap because I currently block the entire server. I now want to redo this the right way. I use launch
since the job doesnt return anything, it just does stuff. I know I can ask that job isActive()
and stuff like that but how can I ask access that jobs memory, like shared memory? I just want to ask how many items it has processed etc so I can show that in my frontend.Bernhard
02/10/2019, 9:57 PMelizarov
02/11/2019, 6:52 AMGlobalScope.launch
is what you typically do nowadays), showing how to improve your code with structured concurrency a bit later. If we jump right away into the structured concurrency, as you suggest, then there is a risk it’ll look totally like magic for readers, so that people with a prior threads/async experience will have no way to bridge it to their existing knowledge.antonis
02/11/2019, 9:50 AMck
02/11/2019, 11:14 AMGlobalScope.launch
? A CoroutineExceptionHandler
?svenjacobs
02/11/2019, 11:48 AMChannel
. However I'm a bit lost here. Here's the simplified pseudo code:
suspend fun Query.onSnapshotAsync(scope: CoroutineScope) =
scope.produce {
addSnapshotListener { snapshot ->
send(snapshot.documents)
}
}
however at send()
it gives me the error suspension functions can be called only within coroutine body
. Usually I wrap legacy callbacks with suspendCoroutine
but in this case this is not possible since the listener fires multiple times but a Continuation can only be resumed once. What is the best practice here?tseisel
02/11/2019, 4:40 PMassertThat
statement is never reached. Why ?kenkyee
02/11/2019, 10:15 PMvngantk
02/12/2019, 3:16 AMmp
02/12/2019, 2:02 PMAlessandro Diaferia
02/12/2019, 3:49 PMsearch
function and this function depends on a series of initialization steps that the instance has to perform before being able to actually search and return results.
How would you handle this using coroutines? Would you have an initialize
function that returns a Job
or would you simply mark search
as suspend
and “hide” the suspension as an implementation detail waiting internally for the initialization job to complete? Or would you tackle this issue in a completely different way?nicholasnet
02/12/2019, 9:20 PMkawmra
02/13/2019, 8:33 AMcoroutineScope()
and the scope created with launch()
or async()
?
Both coroutineScope()
and launch()
create new instance of CoroutineScope (maybe AbstractCoroutine), the both do create new coroutine scope, right?
If the coroutine throws an error, the parent coroutine will be canceled too.
But if the coroutine inside of the scope created by coroutineScope()
throws an error, the coroutine that called the coroutineScope()
will not be canceled. Why?
Is it that the coroutine created by coroutineScope()
is not a child of the coroutine that did call coroutineScope()
?
Or there is something different between the two scopes?
This very confuses me to understand what the coroutine scope is.ck
02/13/2019, 1:26 PMShrinking...
Removing unused program classes and class elements...
Original number of program classes: 9596
Final number of program classes: 9596
Obfuscating...
Printing mapping to [/Users/jenkins/Public/workspace/Android-App_ck_ANDROID-313/app/build/outputs/mapping/playStore/release/mapping.txt]...
Warning: Exception while processing task java.io.IOException: java.util.EmptyStackException
Thread(Tasks limiter_1): destruction
> Task :app:transformClassesAndResourcesWithProguardForPlayStoreRelease FAILED
FAILURE: Build failed with an exception.
aaverin
02/13/2019, 1:38 PMJuan Rada
02/13/2019, 5:22 PMcommons-io
?sitepodmatt
02/14/2019, 4:23 AMsitepodmatt
02/14/2019, 4:24 AMsitepodmatt
02/14/2019, 6:13 AMAlessandro Diaferia
02/14/2019, 3:09 PMdispatch_once
in the Kotlin Coroutine world?igor.wojda
02/14/2019, 4:00 PMJobCancellationException
and I am not sure what is the reason. My only hypothesis is that I am starting and canceling multiple times function that is in suspended state 🤔 but honestly I am not sure… Can somebody throw more light on this? What is the reason for throwing this exception?minisu
02/15/2019, 8:53 AMCyclicBarrier
. How can I achieve something similar with coroutines?spierce7
02/15/2019, 2:34 PMjivimberg
02/15/2019, 4:20 PMSam
02/15/2019, 10:00 PMzak.taccardi
02/15/2019, 10:14 PM1.1.1
) include a library that uses experimental coroutines (0.30.2
)?addamsson
02/15/2019, 11:08 PMsitepodmatt
02/16/2019, 4:18 AMcamdenorrb
02/17/2019, 3:51 PMcamdenorrb
02/17/2019, 3:51 PMelizarov
02/17/2019, 3:59 PMcamdenorrb
02/17/2019, 3:59 PMelizarov
02/17/2019, 3:59 PMcamdenorrb
02/17/2019, 3:59 PMelizarov
02/17/2019, 4:00 PMcamdenorrb
02/17/2019, 4:00 PMelizarov
02/17/2019, 4:01 PMcamdenorrb
02/17/2019, 4:01 PMelizarov
02/17/2019, 4:01 PMcamdenorrb
02/17/2019, 4:01 PMelizarov
02/17/2019, 4:02 PMcamdenorrb
02/17/2019, 4:02 PMelizarov
02/17/2019, 4:43 PMcamdenorrb
02/17/2019, 4:43 PMelizarov
02/17/2019, 4:44 PMcamdenorrb
02/17/2019, 4:45 PMelizarov
02/17/2019, 4:45 PMcamdenorrb
02/17/2019, 4:46 PMdewildte
02/18/2019, 6:03 PM