Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit bd490ad

Browse files
committed
Fix deprecated async usage
1 parent 9410be6 commit bd490ad

File tree

1 file changed

+2
-4
lines changed
  • anko/library/generated/coroutines/src/main/java

1 file changed

+2
-4
lines changed

anko/library/generated/coroutines/src/main/java/bg.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919

2020
package org.jetbrains.anko.coroutines.experimental
2121

22-
import kotlinx.coroutines.Deferred
23-
import kotlinx.coroutines.async
24-
import kotlinx.coroutines.newFixedThreadPoolContext
22+
import kotlinx.coroutines.*
2523

2624
@PublishedApi
2725
@Deprecated(message = "Use the default pool")
2826
internal var POOL = newFixedThreadPoolContext(2 * Runtime.getRuntime().availableProcessors(), "bg")
2927

3028
@Deprecated(message = "Use the default pool", replaceWith = ReplaceWith("async(block)", "kotlinx.coroutines.async"))
31-
inline fun <T> bg(crossinline block: () -> T): Deferred<T> = async(POOL) {
29+
inline fun <T> bg(crossinline block: () -> T): Deferred<T> = GlobalScope.async(POOL, CoroutineStart.DEFAULT) {
3230
block()
3331
}

0 commit comments

Comments
 (0)