Skip to content
Write your asynchronous Network / IO call painlessly in Kotlin !!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Update documentation Mar 26, 2019
asynkio v-1.0.2 Mar 26, 2019
docs Update Documentation Mar 28, 2019
gradle/wrapper Add Jan 15, 2019
.gitignore Add Authorization support Jan 14, 2019
.travis.yml library version 1.0.0 Feb 21, 2019
LICENSE Create LICENSE Mar 28, 2019
README.md Update Documentation Mar 28, 2019
build.gradle Add library to jcenter pkg name change Jan 16, 2019
gradle.properties Refactored Jan 9, 2019
gradlew Refactored Jan 9, 2019
gradlew.bat Refactored Jan 9, 2019
settings.gradle Refactored Jan 9, 2019

README.md

Asynkio : Write asynced IO/ Network calls painlessly on android

Awesome Kotlin Badge| Download | Build Status | Documentation

Write your network requests, IO calls in android with Kotlin seamlessly. Asynkio Inspired by python's asyncio

What I mean is..

async {
    //All network requests on couroutines
    val response = await {
        //Get the data
        val resp = get("https://awesome.com/lib", params = mapOf("lib" to "Asynkio"))

        //Post the data
        return@await post("https://youareonfire.com/lib", data = mapOf("id" to resp.jsonObject["id"]))
    }
    //Process the result on UI thread
    if (response.statusCode == 200){
        yoTextView.text = response.text
    }
}

Yes, that's it. No retrofit. No Volley. Java/Kotlin are very bad at handling the http requests, but still Asynkio is the optimal way. No extra overhead, Seriously...No bullshit!

Another example

async {
    filename = await {
        longRunningFileOperation(content)
    }
}.onError {
    Toast.makeText(context, "Oops ! it failed",Toast.LENGTH_LONG).show()
}.finally {
    closeTheFile(filename)
}

Want to use it? Checkout full documentation over here Getting Started

Implementation

Gradle

implementation 'me.nikhilchaudhari:asynkio:{latest-version}'

Maven

<dependency>
	<groupId>me.nikhilchaudhari</groupId>
	<artifactId>asynkio</artifactId>
	<version>{latest-version}</version>
	<type>pom</type>
</dependency>

Please check releases for latest version

Documentation


License

   Copyright 2019 @ Nikhil Chaudhari

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
You can’t perform that action at this time.