https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

dave08

06/26/2018, 5:20 PM
I think that maybe in this context of Process, the only blocking that really needs to be done is when retrieving the result of a command sent to the process, so maybe there could be some kind of logic to block only until idle for a certain amount of time and then just yield until the next command is sent...?
l

louiscad

06/26/2018, 5:37 PM
Once you're on a blocking method call, there's no going back. You can't cancel a blocking call (unless an async API is there to unlock the blocked method call)
n

nwh

06/26/2018, 6:21 PM
Also, some commands receive continuous feedback from the console, like if a file is downloading
d

dave08

06/26/2018, 7:34 PM
But when reading pieces from a stream, each piece may be blocking, but returns after reading, also my proposition was to keep on reading while measuring time lapses, if beyond a certain window of idle time of not recieving anything, then you can safely yield... but if all the commands are long running anyways, then I agree you're not gaining much.
5 Views