Is there a way to launch a coroutine that 'listens' to stdin input while the rest of the program runs? something like
launch { while(true) { //listen to keyboard input and do stuff } }
j
Jonathan
02/20/2018, 4:18 PM
what about:```
/**
* Create a listener for stdin [System.in] and return a channel through which all user inputs lines are sent.
*
* (One element in the channel = one line entered by the user)
*
* Closing the channel would end the listener
*/
fun createStdindListener(): ReceiveChannel<String> = produce {
System.