Enroscar Async Compiler

Processor for @Load/@Send annotations

Лицензия

Лицензия

Группа

Группа

com.stanfy.enroscar
Идентификатор

Идентификатор

enroscar-async-compiler
Последняя версия

Последняя версия

2.0-RC3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Enroscar Async Compiler
Processor for @Load/@Send annotations
Ссылка на сайт

Ссылка на сайт

https://github.com/stanfy/enroscar-async
Система контроля версий

Система контроля версий

https://github.com/stanfy/enroscar-async

Скачать enroscar-async-compiler

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.stanfy.enroscar/enroscar-async-compiler/ -->
<dependency>
    <groupId>com.stanfy.enroscar</groupId>
    <artifactId>enroscar-async-compiler</artifactId>
    <version>2.0-RC3</version>
</dependency>
// https://jarcasting.com/artifacts/com.stanfy.enroscar/enroscar-async-compiler/
implementation 'com.stanfy.enroscar:enroscar-async-compiler:2.0-RC3'
// https://jarcasting.com/artifacts/com.stanfy.enroscar/enroscar-async-compiler/
implementation ("com.stanfy.enroscar:enroscar-async-compiler:2.0-RC3")
'com.stanfy.enroscar:enroscar-async-compiler:jar:2.0-RC3'
<dependency org="com.stanfy.enroscar" name="enroscar-async-compiler" rev="2.0-RC3">
  <artifact name="enroscar-async-compiler" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.stanfy.enroscar', module='enroscar-async-compiler', version='2.0-RC3')
)
libraryDependencies += "com.stanfy.enroscar" % "enroscar-async-compiler" % "2.0-RC3"
[com.stanfy.enroscar/enroscar-async-compiler "2.0-RC3"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.squareup : javawriter jar 2.5.0
com.stanfy.enroscar : enroscar-async-rx-annotations jar 2.0-RC3
com.stanfy.enroscar : enroscar-async-interface jar 2.0-RC3

test (5)

Идентификатор библиотеки Тип Версия
com.google.testing.compile : compile-testing jar 0.6
com.google.truth : truth jar 0.27
junit : junit jar 4.12
com.google.guava : guava jar 18.0
io.reactivex : rxjava jar 1.0.14

Модули Проекта

Данный проект не имеет модулей.

Enroscar Async

Makes it easy to put your asynchronous operations behind Android's Loader.

Main abstraction here is Async which represents some asynchronous operation.

How it is used

Read our recipes page. Here is a quick overview.

Describe an asynchronous operation.

class Foo {
  @Load Async<String> loadGreeting(final String name) {
    return Tools.async(new Callable<String>() {
      public String call() {
        try { Thread.sleep(1000); } catch (InterruptedException ignored) { }
        return "Hello " + name;
      }
    });
  }
}

In this example we create a simple Callable and pass it to Tools.async method that constructs an Async implementation running our Callable in Android's AsyncTask.

An annotations processor generates an operator class FooOperator that can be used to start/cancel your operations or subscribe to their execution results. Use it!

// this an object that provides operations
Foo foo = new Foo();

// prepare the operator
// FooOperator is a generated class
FooOperator operator = FooOperator.build()
    .withinActivity(activity)
    .operations(foo)
    .get();

// subscribing
operator.when().loadGreetingIsFinished()
    .doOnResult(new Action<String>() {
      @Override
      public void act(final String greeting) {
        Log.i("Async", "Greeting loaded: " + greeting);
      }
    });

// starting
operator.loadGreeting();

// cancelling
operator.cancelLoadGreeting();    

Note that working with an operator you actually control an Android Loader. Hence, using it within an Activity or Fragment you do not care about their lifecycle. Actions you provide subscribing to operations will be automatically attached to running tasks during Activity recreation.

Download

Maven Central

Gradle

compile 'com.stanfy.enroscar:enroscar-async:{latestVersionHere}'
// annotation processor should be added to 'provided' configuration
// it will not be included to your apk
provided 'com.stanfy.enroscar:enroscar-async-compiler:{latestVersionHere}'

To use it with RxJava you'll also need

compile 'com.stanfy.enroscar:enroscar-async-rx:{latestVersionHere}'
compile 'com.netflix.rxjava:rxjava-core:{latestVersionHere}'

License

 Copyright 2011-2015 Stanfy Corp.

 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.
com.stanfy.enroscar

Stanfy

Версии библиотеки

Версия
2.0-RC3
2.0-RC2
2.0-RC1
2.0.alpha3
1.0.0
1.0-RC2
1.0-RC1