Dmytro Danylyk
03/30/2018, 10:48 AMconsumeEach
for channels with CoroutineContext
parameter?
Now:
launch(CommonPool) {
channel.consumeEach { ... }
}
Propose:
channel.consumeEach(CommonPool) { ... }
Dmytro Danylyk
03/30/2018, 10:48 AMelizarov
03/30/2018, 10:51 AMwithContext(CommonPool) { channel.consumeEach { ... } }
. Do you really use it often?elizarov
03/30/2018, 10:52 AMconsumeEach
and non-suspending function (that forks a new coroutine) with the same name.Dmytro Danylyk
03/30/2018, 10:53 AMDo you really use it often?that’s how I usually consume data from channels 🙂
Dmytro Danylyk
03/30/2018, 11:00 AMIt would be very confusing IMHO if we have suspending function (that waits until work done) namedName is not my point here, we can name it differently 🙂and non-suspending function (that forks a new coroutine) with the same name.consumeEach
kenkyee
03/30/2018, 11:19 AMDmytro Danylyk
03/30/2018, 11:20 AMtravis
03/30/2018, 11:56 PMwithTimeout
be used with SubscriptionReceiveChannel.consumeEach
? Perhaps I'm just using it incorrectly? It never breaks out of the `consumeEach`:travis
03/30/2018, 11:56 PMtravis
03/31/2018, 12:31 AMwithTimeout
in a try
and in the catch
I re-throw using throw IllegalStateException(e)
then I get the IllegalStateException
as expected. Is that the intended behavior?
It was a bit confusing for me not to see the TimeoutCancellationException
using the above code snippet.Dmytro Danylyk
03/31/2018, 8:29 AMRedundant 'suspend' modifier less... (⌘F1)
This inspection reports 'suspend' modifier as redundant if no other suspend functions are called inside
Dmytro Danylyk
03/31/2018, 8:31 AMsuspend
modifier to mark functions which perform ‘heavy’ operations.Marek Defeciński
03/31/2018, 8:39 AMMarek Defeciński
03/31/2018, 8:40 AMMarek Defeciński
03/31/2018, 8:41 AMDmytro Danylyk
03/31/2018, 8:45 AMUserDataSource#getUserById(id: Long)
Dmytro Danylyk
03/31/2018, 8:45 AMgetUserById
is a ’heavy` operation and you need to launch coroutine to deal with it?Marek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:47 AMMarek Defeciński
03/31/2018, 8:48 AMMarek Defeciński
03/31/2018, 8:49 AMMarek Defeciński
03/31/2018, 8:49 AMMarek Defeciński
03/31/2018, 8:49 AMMarek Defeciński
03/31/2018, 8:49 AMMarek Defeciński
03/31/2018, 8:49 AM