stanfy/enroscar — pull request #39 by roman-mazur (2014-04-07 10:06:51+00:00)
Title: DO NOT MERGE: async library redesign

/cc @lampapos

Annotation processors are not ready yet.
Take a look at `AsyncUserActivity`.

Generally:
```java
class Operations { // may be even an activity or fragment
@Load Async> orderItems() {
return implementation;
}
@Send Async submitOrder() {
return implementation;
}
}

void onCreate() {
// ...
// generated class
OperationsOperator operator = OperationsOperator.build()
.operations(new Operations())
.withinActivity(this)
.get();

operator.when().orderItemsIsFinished()
.doOnResult((List items) -> { /* Display them. */ })
.doOnError((Throwable e) -> { /* whatever */ })

.alsoWhen().submitOrderIsFinished()
.doOnResult({ /* Remove that annoying progress bar. */ });

submitButton.setOnClickListener({ operator.submitOrder(); });

operator.orderItems();
}

```