marcoferrer
02/17/2019, 9:04 PMserebit
02/17/2019, 11:20 PMJaroslav
02/19/2019, 6:12 AMReceiveChannel
object, but in iOS I cannot instantiate Kotlinx_coroutines_core_nativeReceiveChannel
because it has no accessible initializerstatyana
02/19/2019, 12:00 PMpardom
02/19/2019, 4:35 PMcbruegg
02/19/2019, 6:26 PMreturn
in case response.body()
is null, i.e. the let
path is not executedbasher
02/20/2019, 2:54 AMseb
02/21/2019, 3:22 AM#coroutines
channel", so I figured I come here ^^
Anyone have a link for an example? Thank you so much.Landerl Young
02/21/2019, 8:53 AMfun main() = runBlocking {
sth().await()
}
suspend fun sth() = coroutineScope {
async(start = CoroutineStart.LAZY) {
println("async execution")
}
}
The main function blocks forever, and the “async execution” is never printed. Could anyone give a hand, thanks.
😘sdeleuze
02/21/2019, 9:05 AMAntanas A.
02/21/2019, 9:11 AMsuspend fun connectToSocket() {
suspend fun process(session: DefaultClientWebSocketSession) {
while (session.isActive) {
session.incoming.onReceiveOrNull { frame ->
if (frame == null) {
session.close()
delay(2000)
connectToSocket() // <- do reconnect
}
}
}
}
process(startSession())
}
connectToSocket()
ansman
02/21/2019, 3:30 PMJobCancelledException
which I thought was never supposed to cause a crashansman
02/21/2019, 4:27 PMfun processImage() {
val file = createFile()
try {
// Do stuff with the file
} finally {
file.delete
}
}
suspend fun createFile(): File = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
return File.createTemporaryFile("foo", "temp")
}
There is a case where createFile
has finished but processImage
has not yet been resumed. If during this time the job is cancelled we’ll never get a chance to clean up the file. Is there a way around this?spierce7
02/21/2019, 4:36 PMCoroutineStart.ATOMIC
does? The documentation isn't very clear to me.Herko
02/22/2019, 11:53 AMitasyurt
02/22/2019, 3:16 PMHerko
02/22/2019, 3:29 PMHerko
02/22/2019, 5:45 PMbasher
02/23/2019, 3:47 AM.freeze()
on an object, somewhere along the line it calls FreezeSubgraph
internally. What is it that determines what is part of an object's subgraph that also gets frozen as a part of that object's freeze operation?Kulwinder Singh
02/23/2019, 10:45 AMcoroutine
takes more than 700+ millis
. is it normal ? ,does launch
builder takes that much of time?,i'm using this in android while displaying splash screen and then after 3 seconds delay closing splashibcoleman
02/23/2019, 6:05 PMgetTESTInventoryPage(pg: Int)
makes a long-running SOAP call. I expected things to blow up--instead it appears to make the calls in an arbitrary order, but eight at a time (which happens to be the number of virtual cores on my machine. Which is exactly what I want. Which is extremely suspicious... 🙂Felix
02/23/2019, 8:09 PMyschimke
02/24/2019, 10:19 AMansman
02/24/2019, 4:14 PMfun events(channel: SendChannel<Event>)
fun events(scope: CoroutineScope): ReceiveChannel<Event>
In my case I need to add a listener when calling events
and remove it when the channel is closedPaulius Ruminas
02/25/2019, 6:37 AMrunBlocking {
val producer = async {
produce {
send(1)
send(2)
send(3)
}
}
launch {
producer.await().consumeEach { println(it) }
}
}
cbruegg
02/25/2019, 5:14 PMvar delayedJob: Job? = null
fun onEvent() {
delayedJob?.cancel()
delayedJob = launch {
delay(1000)
// Do stuff
}
}
ivan.savytskyi
02/25/2019, 8:13 PMjob.children.toList()
? By looking into source seems should be fine, but want to confirmantonis
02/26/2019, 8:05 AMminivac
02/26/2019, 10:37 AMvoddan
02/26/2019, 2:06 PMvoddan
02/26/2019, 2:06 PMlouiscad
02/26/2019, 2:17 PMgildor
02/26/2019, 2:53 PMsitepodmatt
02/26/2019, 4:13 PMlouiscad
02/26/2019, 4:51 PMyield()
if the operation is actually a sum or loop of smaller I/O operations.voddan
02/28/2019, 4:04 PMgildor
02/28/2019, 4:30 PMvoddan
03/01/2019, 3:16 PM