Is there currently a way to call `withContext(Comm...
# coroutines
l
Is there currently a way to call
withContext(CommonPool) { ... }
just like
withContext { ... }
? (similarly as async { } can be called on default pool) However just
withContext { ... }
might seem confusing, so maybe it would be nice to add some shorthand with a different name for this if there isn't anything like that already 🙂
g
No, there is no such overload, why do you need this?
l
Well, I just wanted to do simple async {}.await(), but on a CommonPool, that is all 🙂. My app is quite small for now, so I don't mind running all coroutines in the default pool. However when I use the above, I get a (weak) warning that I should use the withContext for this, which requires me to specify the pool explicitly (unlike async). So maybe it could be nice to have some "default-pool" version of withContext function, but I have no idea what would be a good name for such a function, since this is a bit tricky 😄 . Maybe something like
withDefaultContext {}
or just
defaultContext {}
, but both maybe feel to be still too long 🙂.