io

suspend fun <R> io(operation: suspend () -> R): R

Run the provided I/O operation, returning whatever result is returned by the operation.

The operation is executed against the I/O dispatcher (Dispatchers.IO).

Return

Deferred task providing the result of the operation.

Parameters

R

Return type.

operation

Operation to run. Can suspend.