Home

Awesome

Kommander

Kommander is a Java asynchronous Command Pattern implementation, specially recommended to solve Android UI Thread Issue.

Usage

Kommander is designed to be really simple to use. First of all, you need to create a Kommander instance.

Kommander kommander = Kommander.getInstance();

That was easy, right? Now, let's launch an asynchronous execution.

Kommands

kommander.makeKommand(() -> interactor.searchMovie("Titanic"))
    .setOnCompleted(this::paintMovies)
    .kommand();

This example is executing an asynchronous search of a movie and releases the result on paintMovies() when all has worked fine.

KommandTokenBox

When you make Kommand.kommand() you receive a KommandToken instance to take control of the kommand cancellation with KommandToken.cancel(), but often managing these tokens is a few unpleasant. So you can take advance of KommandTokenBox to easy the cancel control.

Download

Kommander is available on jcenter. Please ensure that you are using the latest version checking <a href="https://bintray.com/wokdsem/maven/kommander/view">here</a>.

Maven:

<dependency>
  <groupId>com.wokdsem.kommander</groupId>
  <artifactId>kommander</artifactId>
  <version>1.3.0</version>
</dependency>

Gradle:

compile 'com.wokdsem.kommander:kommander:1.3.0'

License

Copyright 2017 Wokdsem

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.