Coroutines

object Coroutines

Functions

Link copied to clipboard
fun <T> T.ioSafe(work: suspend CoroutineScope.(T) -> Unit): Job
Link copied to clipboard
suspend fun <T, V> V.ioWork(work: suspend CoroutineScope.(V) -> T): T
Link copied to clipboard
suspend fun <T, V> V.ioWorkSafe(work: suspend CoroutineScope.(V) -> T): T?
Link copied to clipboard
fun <T> T.main(work: suspend (T) -> Unit): Job
Link copied to clipboard
suspend fun <T, V> V.mainWork(work: suspend CoroutineScope.(V) -> T): T
Link copied to clipboard
fun runOnMainThread(work: () -> Unit)
Link copied to clipboard
fun <T> threadSafeListOf(vararg items: T): MutableList<T>

Safe to add and remove how you want If you want to iterate over the list then you need to do: synchronized(allProviders) { code here }