ursus
03/15/2025, 3:13 PMval channel = ...
for (message in channel) { <-------
//
}
while (true) {
val message = channel.receive() <-------
}
What exactly is the for ... channel
syntax sugar for? is it the while loop as I wrote it?
I'm looking at sources of the iterator private class Itr<E>(@JvmField val channel: AbstractChannel<E>) : ChannelIterator<E> {
and in it's next
implementation, there is no receive
.. so idk?
(the context is ktor websockets; and there's a receiveDeserialied
helper function I'd like to use)jw
03/15/2025, 3:15 PMwhile
example doesn't haveursus
03/15/2025, 3:17 PMursus
03/15/2025, 3:18 PMreceiveDeserialized
, its just json parsing bolted on top the text framejw
03/15/2025, 3:23 PM