korlibs / docs.korge.org

MIT License
1 stars 1 forks source link

Document what the difference is between async=true and async=false for vfs #49

Open Kietyo opened 1 year ago

Kietyo commented 1 year ago
image

Like what's the difference between them, what's the benefit of using one over the other? What are some scenarios where I should I use one over the other.

soywiz commented 1 year ago

We should add it to the documentation, but in the mean time:

It is useful for example for debugging/developing. Suspending sometimes don't give good stacktraces. For the one not suspending, you will have normal stacktraces. It also allows for to run code within runBlockNoSuspensions { ... } since no suspensions happen, that works in common code. Alternatively runBlockingNoJs { ... } could work if you are not targetting JS in that codw.