<@U5R5FGVH7> Yes, start a new Thread that runs the...
# announcements
k
@napperley Yes, start a new Thread that runs the loop.
n
How would the low CPU usage be achieved without resorting to the dreaded while (true) { // ... }
k
Use a
SyncronizedQueue<Event>
for the events, and just call
poll()
on it in the while loop, it will automatically wait until there are events and call
put(event)
when there's a new even, it will automatically resume the main loop.
n
Appears as though readLine() doesn't work in Kotlin 1.1.3-2 (not in plain Kotlin programs). Should block to read in keyboard input (expected behaviour) but skips the process instead. Strange thing is readLine() works fine in the Kotlin REPL 😕 .
Rather disturbing that earlier Kotlin 1.1 versions are also affected by the same issue ☝️ .