Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 976 Bytes

README.md

File metadata and controls

34 lines (30 loc) · 976 Bytes

ASYNC-ELLA-kotlin

A library to write easier and more manageable asynchronous code for multi-platform usage.

async {
  someTask()
}

Based on Swift's approach of the asynchronous imperative code, this was implemented into Kotlin for usage in multithread concurrencies. Calling await in the background thread does not freeze the main thread. This library is multiplatform compatible under the KMM module | gradle implementation and exports clean and concise swift code for the iOS application.

Usage

async {
  val multiThreading = await {
    LongAwaitedFunc()
  }
}

Await can also be run in for loops, try/catches and almost anything allowing concurrency. Errors in code, while dispatching async/await can be noticed with the onError modifier

async {
   val dynamicText = await {
      // Exception is thrown in the background thread
   }
   // Process dynamic text ehre
}.onError {
   // Handle exception in main thread
}