Add a contract to coroutineScope, withContext and operator fun invoke for CoroutineDispatcher
See original GitHub issueNow that there is an EAP kotlinx.coroutines version for 1.3.40 EAP, and since 1.3.40 supports contracts for suspending functions, we can add contracts for the lambdas of the following functions in this library:
coroutineScope
withContext
invoke
(extension function forCoroutineDispatcher
)
I can make a PR on the 1.3.40-eap branch.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Best practices for coroutines in Android
This page presents several best practices that have a positive impact by making your app more scalable and testable when using coroutines.
Read more >Coroutine Scope, Suspend and withContext inquiries
It's the right way to write suspending functions, when you don't worry about the current thread when you call a function. It's regarding...
Read more >Change log for kotlinx.coroutines
All coroutine builders use Dispatchers.Default by default if CoroutineInterceptor is not present in their context. CoroutineScope became the first-class citizen ...
Read more >Coroutine context and dispatchers - Kotlin
The coroutine context includes a coroutine dispatcher (see CoroutineDispatcher) that determines what thread or threads the corresponding ...
Read more >kotlin协程Source :: 郑欢的学习总结
public fun CoroutineScope.launch( context: CoroutineContext ... public operator fun <R, T> invoke(block: suspend R.() -> T, receiver: R, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please hold on with PR unless the
develop
branch is fully migrated to Kotlin 1.3.40The reason is architectural, relative to the compiler front-end, I found my own issue, reported 2 years ago 😅
https://youtrack.jetbrains.com/issue/KT-32313