Kotlin coroutine async implementation without java 8 requirement.
Kotlin
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
LICENSE
README.md
build.gradle.kts
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

async-under8

Library built upon Kotlin coroutines. Forked from kotlinx.coroutines (kotlinx-coroutines-async), but drops java 8 requirement.

This modification allows libraries to use asnyc and runs under most of Android devices.

Thanks to tikurahul - kotlin-futures implementation.

Example

import async_under8.async
import com.rahulrav.futures.Future

private fun startLongAsyncOperation(v: Int) =
        Future.submit {
            Thread.sleep(1000)
            "Result: $v"
        }

fun main(args: Array<String>) {

    val future = async<String> {
        (1..5).map {
            await(startLongAsyncOperation(it))
        }.joinToString("\n")
    }

    future.onSuccess {
        println(it)
    }
}

Status

Build Status

Download

Download

or depend via Gradle:

compile 'com.fboldog.async_under8:async_under8:0.0.1'

or Gradle Kotlin Script:

compile("com.fboldog.async_under8:async_under8:0.0.1")

or Maven:

<dependency>
  <groupId>com.fboldog.async_under8</groupId>
  <artifactId>async_under8</artifactId>
  <version>0.0.1</version>
</dependency>