Skip to content

Commit

Permalink
Changed method names to match closer to ES6.
Browse files Browse the repository at this point in the history
  • Loading branch information
MammatusPlatypus committed Apr 10, 2016
1 parent 3a30160 commit c6d9eb4
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

[Reakt website](http://advantageous.github.io/reakt)

Reactive interfaces for Java.
***Reactive interfaces for Java.***

Reakt is reactive interfaces for Java:
* Promises,
Reakt is reactive interfaces for Java which includes:
* Promises,
* Streams,
* Callbacks,
* Async results

The emphasis is on defining interfaces that enable lambda expressions,
and fluent APIs for asynchronous programming for Java.

Note: This mostly just provides the interfaces not the implementations. There are some starter implementations but the idea is that anyone can implement this. It is all about interfaces. There will be adapters for Vertx, RxJava, Reactive Streams, Guava Async Futures, etc.

Note: This mostly just provides the interfaces not the implementations. There are some starter implementations but the idea is that anyone can implement this. It is all about interfaces. There will be adapters for Vertx, RxJava, Reactive Streams, etc. There is support for ***Guava Async*** (used by Cassandra) and the ***QBit*** microservices lib.

## Getting started
#### Using from maven

```xml
Expand Down Expand Up @@ -68,17 +70,34 @@ with Callbacks directly.
});
```

In both of these examples, lookupService would look like:
In both of these examples, lookupEmployee would look like:

#### Using Result and callback directly
```java

public void lookup(long employeeId, Callback<Employee> callback){...}
public void lookupEmployee(long employeeId, Callback<Employee> callback){...}

```

You can use Promises to transform into other promises.

#### Transforming into another type of promise using thenMap
```java

Promise<Employee> employeePromise = Promises.<Employee>blockingPromise();

Promise<Sheep> sheepPromise = employeePromise
.thenMap(employee1 -> new Sheep(employee1.getId()));
```

The `thenMap` will return a new type of Promise.

You can find more examples in the [reakt wiki](https://github.com/advantageous/reakt/wiki).

We also support working with streams.


## Promise API concepts
## Promise concepts

This has been adapted from this [article on ES6 promises](http://www.html5rocks.com/en/tutorials/es6/promises/).
A promise can be:
Expand Down

0 comments on commit c6d9eb4

Please sign in to comment.