Even better, is to encapsulate your file operation...
# coroutines
e
Even better, is to encapsulate your file operations into suspending functions, hiding all this
run
invocations from the actual logic:
Copy code
suspend fun doSomeFileOp() = run(fileContext) { 
   // some blocking file-manipulating code here
}
Now, if you place all this file ops into a separate
MyFileOps.kt
file, you can make
fileContext
private to that file and the encapsulation will be total.
­čśŹ 2