waitForAsync

suspend fun waitForAsync(): Int(source)

Delays the current coroutine until Process completion.

NOTE: For Jvm & Android the kotlinx.coroutines.core dependency is needed.

NOTE: Care must be had when using Async APIs such that, upon cancellation, Process.destroy is still called.

Return

The Process.exitCode

See also

io.matthewnelson.kmp.process.Blocking.waitFor

suspend fun waitForAsync(duration: Duration): Int?(source)

Delays the current coroutine for the specified duration, or until Process.exitCode is available (i.e. the Process completed).

NOTE: For Jvm & Android the kotlinx.coroutines.core dependency is needed.

NOTE: Care must be had when using Async APIs such that, upon cancellation, Process.destroy is still called.

Return

The Process.exitCode, or null if duration is exceeded without Process completion.

Parameters

duration

the Duration to wait

See also

io.matthewnelson.kmp.process.Blocking.waitFor