collectInputs
suspend fun Terminal.collectInputs(collectInputsParameters: CollectInputsParameters): List<CollectInputsResult>
Return
A list of CollectInputsResult containing the collected inputs
Parameters
collectInputsParameters
Parameters defining what inputs to collect
See also
Collects custom inputs from the reader.
This suspend function integrates with Kotlin's structured concurrency. If the coroutine calling this function is cancelled, the underlying collect operation will automatically be cancelled as well.
Example usage:
val job = coroutineScope.launch {
try {
val results = terminal.collectInputs(collectInputsParameters)
// Handle successful input collection
} catch (e: TerminalException) {
// Handle input collection failure
}
}
// Cancelling the job will cancel the collect inputs operation
job.cancel()Content copied to clipboard
Throws
if the collection operation fails