kirillrakhman
12/22/2016, 2:38 PMclass Producer(private val queue: BlockingQueue) : Runnable {
override fun run() = try {
while (true) queue.put(produce())
} catch(e: InterruptedException) {
// handle
}
fun produce(): Any { ... }
}
9 lines idiomatic Kotlin vs. 10 lines compressed java and I even put the catch
body on separate lines and used a blank line between the functions