Wouter De Vos
10/16/2023, 2:28 PMFilipp Zhinkin
10/17/2023, 8:07 AMI am then using this interface to mock stdin for unit tests but I am at a bit of a loss as to how I await input.Without a context, I would suggest creating a synchronization protocol using Channel. For example, you can use one channel to notify a "control" coroutine that the execution has reached the
readln
and then start waiting for data from another data-channel. And the control-coroutine may eventually (depending on how long you need a client code to await for data from readln
) send data to the data-channel unblocking the readln
.Wouter De Vos
10/18/2023, 9:52 AM