mingkangpan
05/20/2017, 6:52 PMhttps://www.youtube.com/watch?v=X1RVYt2QKQE&feature=youtu.be&t=36m54s▾
cedric
05/24/2017, 1:14 AMDynamicGraph
link on Twitter? Are you trying to run a partially ordered set in parallel?elizarov
05/24/2017, 9:09 PMkirillrakhman
05/26/2017, 3:37 PMthymecypher
05/29/2017, 4:24 AMjava.lang.NoSuchMethodError: No static method launch$default(Lkotlin/coroutines/experimental/CoroutineContext;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/experimental/Job; in class Lkotlinx/coroutines/experimental/BuildersKt; or its super classes (declaration of 'kotlinx.coroutines.experimental.BuildersKt' appears in /data/app/---/base.apk)
at org.jetbrains.anko.sdk25.coroutines.Sdk25CoroutinesListenersWithCoroutinesKt$onClick$1.onClick(ListenersWithCoroutines.kt:284)
elizarov
05/30/2017, 10:14 AMDeferred
). That is why.louiscad
06/01/2017, 3:12 PMlaunch(…) { … }
and async(…) { … }
, but with no doc available in the IDE, it's really inconvenient. I mean, this translates to blind autocompletion, which partly defeats it's purposeelizarov
06/03/2017, 8:51 AMelizarov
06/04/2017, 1:53 PMwaiFor
just waitFor(predecessors: Tasks) = predecessors.forEach { it.await() }
works just as finewouterdoeland
06/04/2017, 4:17 PMprintln("received update."); launch(CommonPool) { println("in pool"); //more code }
code on my desktop, it does print received updated.
and in pool
, but when running it on an Digital Ocean droplet it only prints received update.
. Any reason why?wouterdoeland
06/04/2017, 4:20 PMelizarov
06/07/2017, 5:51 AMmikehearn
06/09/2017, 11:38 AMelizarov
06/12/2017, 9:00 PMisDispatchNeeded
gives an answer: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-coroutine-dispatcher/is-dispatch-needed.html There are lots of good explanations on the web as to why in JS world it is a standard to always schedule execution of async operations for later, as opposed to executing them immediately on stack (in short, it causes lots of subtle problems down the road that do not worth minor performance improvement it gives)elizarov
06/15/2017, 7:04 AMgroostav
06/15/2017, 9:50 PMfinalize()
to resumeWithException
rather than allow for the "abandoned" coroutine phenomina. I just spent a fair bit of time discovering a way we could produce abandoned coroutines and replacing them with an exception flow such that nobody simply gets left hanging (a form of live-lock I suppose?)Natsuki(开元米粉实力代购)
06/16/2017, 7:27 AMverticalLayout {
button("Delay").onClick {
log("click begin")
runBlocking {
log("delay begin")
// delay(30000L)
Thread.sleep(30000L)
log("delay end")
}
log("click end")
}
}
guys,i’m a newbee in coroutine, i tried these piece of code, when change delay to sleep, an ANR was issued by system
i want to know why delay does not issue an ANR and what is main thread doing when the delay clause is executing, would anyone be kind enough to explain this for me ?vaskir
06/16/2017, 8:15 AMoffer
would be the first thing I'd think about. I tried launch(parent-context) { ch.send(..) }
, but it's very slow.elizarov
06/20/2017, 2:07 PMelizarov
06/22/2017, 8:03 AMcontext
?vaskir
06/22/2017, 8:06 AMalucard
06/22/2017, 11:12 AMpipe
function work like a mediator between the producer and consumer?elizarov
06/22/2017, 8:45 PMCoroutineScope
completely and provide top-level val coroutineScope
and coroutineScope.isActive
extensions instead.elizarov
06/27/2017, 8:23 AMval mapAsync = async(context, CoroutineStart.LAZY) { ... your async code here to get the map ... }
Then you’d use it like this fragment.mapAsync.await()
. It is not as clean as property delegate, but works just as fine (100% lazy and remembers the value after initialization)elizarov
06/30/2017, 9:40 AMgildor
07/04/2017, 5:26 PMelizarov
07/05/2017, 7:23 PMrockerhieu
07/06/2017, 7:30 AMval queue = LinkedBlockingQueue<Note>()
var closed = false
init {
async(CommonPool) {
while (!closed) {
while (!closed && queue.isEmpty()) {
delay(50)
}
while (!closed && !queue.isEmpty()) {
play(queue.take())
}
}
}
}
I don't like delay(50)
and I think it's not sufficient.s1m0nw1
07/07/2017, 11:51 AMelizarov
07/10/2017, 9:49 PMkotlinx.coroutines
under the name of CompletableDeferred
(unless we find something better) and is now available in develop
branch.elizarov
07/10/2017, 9:49 PMkotlinx.coroutines
under the name of CompletableDeferred
(unless we find something better) and is now available in develop
branch.rogeralsing
07/11/2017, 5:50 AMgroostav
07/11/2017, 5:56 AMrogeralsing
07/11/2017, 7:07 AMgroostav
07/11/2017, 5:29 PM