Joris PZ
10/19/2018, 8:20 AM.receive()
on a non-blocking NIO channel, it will immediately return with either some available data, or null
. So if I were to use this in a coroutine, I'd have to do this in an infinite loop, no? Something like:
while(true) {
channel.receive(buffer)
// handle data if available
}
If I were to implement it like this, wouldn't that make the CPU load 100%? Or am I supposed to implement a delay here to prevent this?elizarov
10/19/2018, 8:27 AMJoris PZ
10/19/2018, 8:34 AMdave08
10/19/2018, 9:56 AM