Andrei Mukamolau
05/07/2026, 8:51 AMLocationClient.requestLocationUpdates method call wrapped in callbackFlow that accepts an Executor, and I'm passing Dispatchers.IO.asExecutor() to it. Not sure if it makes any difference in terms of performance. Maybe, it's better to construct a separate Executor for this, and close it in awaitClose? It's not clear if there is any overhead with either approach. I didn't have much luck benchmarking the callbacks, too
Thread in Slack ConversationWesley Hartford
05/07/2026, 4:45 PMExecutor.asCoroutineDispatcher() from a Java API that gives me an executor to do things on.
I can't say that it's the best possible approach, but it hasn't hurt me yet. My theory is that it's better to reduce the number of thread pools as long as the intent of the dispatcher matches the intent of the executor. What I mean by that is don't pass Dispatchers.Default.asExecutor() or Dispatchers.Main.asExecutor() to something that is going to do IO on the executor.