coroutinesmanager v1.2.0 Release Notes
Release Date: 2019-11-07 // over 4 years ago-
🔨 Many refactoring and changes
ICoroutinesManager : IAsyncTasksManager
and you can call any async methods insidelaunchOnUI
Example:class MyCoroutinesWorker : ICoroutinesManager {fun onRepeateButtonClickListener() = launchOnUITryCatchFinally( tryBlock = {val result = doTryCatchAsyncAwait( tryBlock = { println("----> ASYNC 'TRY' BLOCK") delay(3000L) "OPERATION COMPLETE" }, catchBlock = { println("----> ASYNC 'CATCH' BLOCK") throw it } ) }, catchBlock = { // Catch an Error on UI with it }, finallyBlock = { // final block }) }
lazy initialization of Dispatcher in
CoroutinesProvider.kt
0️⃣ default
cancelationHandlersSet
inCoroutinesProvider.kt
andICoroutinesManager
can handle cancelation tooval ICoroutinesManager.isCancelled: Boolean
andval ICoroutinesManager.isCompleted: Boolean
👷
fun ICoroutinesManager.cancelAllCoroutines()
- cancel all coroutines with async and UI jobsreplace
var wasCancelled: Boolean
fromIAsyncTasksManager.kt
byval IAsyncTasksManager.isCancelled: Boolean
You can launch async task without calling
launchOnUI
with new functions:launchOnUIAsyncAwait
launchOnUITryCatchAsyncAwait
launchOnUITryCatchFinallyAsyncAwait
launchOnUITryFinallyAsyncAwait
👷 Block try always will be called on Async Job
📚 Documentation added and example changed
🍱 ❤️ Coroutines