Skip to content

Commit

Permalink
Coroutines API opt ins. #372
Browse files Browse the repository at this point in the history
  • Loading branch information
czyzby committed Aug 4, 2021
1 parent 1165387 commit 2f3c876
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion async/src/test/kotlin/ktx/async/KtxAsyncTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong

@DelicateCoroutinesApi
@OptIn(DelicateCoroutinesApi::class)
class KtxAsyncTest : AsyncTest() {
@Test
fun `should execute tasks on the main rendering thread when launched via KtxAsync`() {
Expand Down
5 changes: 1 addition & 4 deletions async/src/test/kotlin/ktx/async/dispatchersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicLong
/**
* Base class with coroutine dispatcher tests.
*/
@DelicateCoroutinesApi
@OptIn(DelicateCoroutinesApi::class)
abstract class CoroutineDispatcherTest : AsyncTest() {
abstract val tested: KtxDispatcher
abstract fun getExecutorThread(): Thread
Expand Down Expand Up @@ -152,7 +152,6 @@ abstract class CoroutineDispatcherTest : AsyncTest() {
}
}

@DelicateCoroutinesApi
class AsyncExecutorDispatcherTest : CoroutineDispatcherTest() {
override val tested = AsyncExecutorDispatcher(AsyncExecutor(1), threads = 1)
override fun getExecutorThread(): Thread = getExecutionThread(tested.executor)
Expand All @@ -178,7 +177,6 @@ class AsyncExecutorDispatcherTest : CoroutineDispatcherTest() {
}
}

@DelicateCoroutinesApi
class ConcurrentAsyncExecutorDispatcherTest : CoroutineDispatcherTest() {
override val tested = AsyncExecutorDispatcher(AsyncExecutor(4), threads = 4)
override fun getExecutorThread(): Thread = getExecutionThread(tested.executor)
Expand All @@ -203,7 +201,6 @@ class ConcurrentAsyncExecutorDispatcherTest : CoroutineDispatcherTest() {
}
}

@DelicateCoroutinesApi
class RenderingThreadDispatcherTest : CoroutineDispatcherTest() {
override val tested = MainDispatcher
override fun getExecutorThread(): Thread = getMainRenderingThread()
Expand Down
2 changes: 1 addition & 1 deletion log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and logged. Formatting itself also features some small overhead - every message

While LibGDX does address the problem of cross-platform logging, but does not provide *any* mechanism for handling logs
with multiple custom parameters. (Possibly because of the *vararg* method call overhead.) Even its `Logger` utility
class provides no methods consuming optional lazy-evaluated arguments - nor does it log class name and current time.
class provides no methods consuming optional lazy-evaluated arguments - nor does it log class name and current time.

The most efficient way of logging with the default LibGDX mechanisms would look somewhat like this:
```Kotlin
Expand Down

0 comments on commit 2f3c876

Please sign in to comment.