uli
12/06/2018, 5:21 PMlaunch(ioContext) {
if (!mutableList.contains(something)) {
modifyActor.send(Add(something))
}
}
launch(ioContext) {
// Actor has not yet processed the 'Add' message, because it was busy processing other requests
if (mutableList.contains(something)) {
//We will not get here
modifyActor.send(Remove(something))
}
}
danny
12/06/2018, 7:09 PMCoroutineScheduler
seems far too conservative about parking threads?Rohan Maity
12/07/2018, 4:38 AMlouiscad
12/07/2018, 10:53 AMjava.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize
(without cause logged). What could be the issue?pablisco
12/07/2018, 2:21 PMDispatchers.Main
when running on the test configuration (e.g. Unit tests)mbonnet
12/07/2018, 2:49 PMrunBlocking
and CoroutineScopes. I want to launch a coroutine in a scope with a combined Job
for this coroutine to run until the job is cancelled. It works fine, but I would like to wrap it in a runBlocking
(for unit tests purposes), but unfortunately the runBlocking
doesn’t wait for the inner launch... Do you have any idea why ? Or how could I make it work somehow ?Tolriq
12/08/2018, 4:39 PMAlexey Pushkarev
12/08/2018, 10:02 PMmarekabaffy
12/09/2018, 4:58 PM.cancelAndJoin()
method. What is it good for? Why would I want to wait until the coroutine actually finishes the cancellation? I bet there is a pretty clear use case, but I just can’t see it.dewildte
12/09/2018, 10:12 PMFabio Tudone
12/10/2018, 11:25 AMchi
12/10/2018, 12:13 PMObsoleteCoroutinesApi
on our production apps? I'll like to use something around actors but worried about this annotationgoldin
12/10/2018, 1:24 PMedwinRNDR
12/10/2018, 2:17 PMThread.yield()
instead of kotlin.coroutines.yield()
?goldin
12/10/2018, 10:27 PMspierce7
12/11/2018, 3:02 AMThis declaration is experimental and its usage should be marked with '@kotlinx.coroutines.ExperimentalCoroutinesApi'
Is there a way I can declare that we are using experimental coroutines api in the build.gradle
, and thus get rid of all these warnings everywhere? Or am I forced to go to every file, and explicitly annotate it?gattacus
12/11/2018, 3:09 PMzak.taccardi
12/11/2018, 6:51 PM<http://Dispatchers.IO|Dispatchers.IO>
when reading from Android's shared preferences?spierce7
12/11/2018, 9:28 PMtasks.withType(KotlinCompile) {
kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"]
}
I notice I get the following error in modules that don't use coroutines at all:
e: Experimental API marker kotlinx.coroutines.ExperimentalCoroutinesApi is unresolved. Please make sure it's present in the module dependencies
Anyone know of a fix?Rohan Maity
12/12/2018, 1:03 AMSlackbot
12/12/2018, 11:55 AMIAmRasputin
12/12/2018, 7:28 PMrunBlocking
exist for the sole purpose of bridging non-blocking with blocking code? If I have a java application that depends on a Kotlin library, would I be able to have the library support coroutines by wrapping the API functions with runBlocking
, or are there other gotchas I need to know so the java application can take advantage of asynchronous code?streetsofboston
12/12/2018, 8:55 PM<http://Dispatchers.IO|Dispatchers.IO>
which is backed by a pool of threads, let’s say “Thread-1” through “Thread-64".
When a suspension point in a suspend function is reached while running in “Thread-4”, does the function always resume in the same thread, “Thread-4", or could it resume in any of the other threads of the thread-pool of <http://Dispatchers.IO|Dispatchers.IO>
(it could be “Thread-35”)?
I think it is the last option (could be in the other threads of the dispatcher), but I’m not sure … 🙂Paul Woitaschek
12/13/2018, 6:14 AMKulwinder Singh
12/13/2018, 9:40 AMcoroutine
i'm getting more data for each item from network like below private fun onItemsLoaded(videosList: List<BaseVideo>) {
uiScope.launch {
val videoAndData = getUserDataForEachVideo(videosList)//suspending function
adapter.addData(videoAndData)
}
}
so here everytime whenever new 5 items loaded then new
coroutine
is created, so here over the time it will increase created coroutines , i know that coroutines are light weight but is there any other way to solve this problem where i can create a single coroutine and then run my code inside that coroutine instead of creating new coroutine everytimeacando86
12/13/2018, 1:08 PMMarc Knaup
12/13/2018, 4:03 PMReceiveChannel
from an Iterable
?
à la
fun <E> Iterable<E>.toChannel() =
GlobalScope.produce { forEach { send(it) } }
Michal Fudala
12/13/2018, 5:02 PMc2
method hang here ?bdawg.io
12/14/2018, 12:37 AMgroostav
12/14/2018, 12:42 AMoperator fun invoke
confusion, kotlin coroutine code:
public fun <R> start(start: CoroutineStart, receiver: R, block: suspend R.() -> T) {
initParentJob()
start(block, receiver, this)
}
that start
call is actually start.invoke(block, receiver, this)
, it is not calling a superclass overload of start
.groostav
12/14/2018, 12:42 AMoperator fun invoke
confusion, kotlin coroutine code:
public fun <R> start(start: CoroutineStart, receiver: R, block: suspend R.() -> T) {
initParentJob()
start(block, receiver, this)
}
that start
call is actually start.invoke(block, receiver, this)
, it is not calling a superclass overload of start
.bdawg.io
12/14/2018, 12:44 AMgroostav
12/14/2018, 1:02 AMoperator fun invoke
is that the thing you have to control-click on (ctrl+B on) is the parenthesisbdawg.io
12/14/2018, 1:35 AM