https://github.com/advantageous/reakt-guava
Bridge between Reakt and Guava Futures. Adds fluent, lambda based programming to Guava futures.
https://github.com/advantageous/reakt-guava
Last synced: 6 months ago
JSON representation
Bridge between Reakt and Guava Futures. Adds fluent, lambda based programming to Guava futures.
- Host: GitHub
- URL: https://github.com/advantageous/reakt-guava
- Owner: advantageous
- Created: 2016-04-08T17:13:01.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-18T22:09:35.000Z (almost 9 years ago)
- Last Synced: 2025-04-06T14:21:33.859Z (9 months ago)
- Language: Java
- Homepage: http://advantageous.github.io/reakt-guava/
- Size: 99.6 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Reakt to Guava Bridge
[Reakt-Guava Website](http://advantageous.github.io/reakt-guava/)
Guava gets used by many libraries for its async support.
Many NoSQL drivers use Guava, e.g., Cassandra.
***Guava*** is JDK 1.6 backwards compatible.
[Reakt](http://advantageous.github.io/reakt/) provides composable
promises that support lambda expressions, and a fluent API.
This bridge allows you to use ***Reakt's*** promises, reactive streams
and callbacks to have a more modern Java experience with libs like
[Cassandra](http://www.datastax.com/dev/blog/java-driver-async-queries)
and other libs that use [Guava](https://github.com/google/guava).
#### Cassandra Reakt example
```java
futureToPromise(session.executeAsync(insertInto("Todo")
.value("id", todo.getId())
.value("createTime", todo.getCreateTime())
.value("name", todo.getName())
.value("description", todo.getDescription()))
).catchError(error -> {
serviceMgmt.increment("add.todo.fail");
serviceMgmt.increment("add.todo.fail." +
error.getClass().getName().toLowerCase());
recordCassandraError();
promise.reject("unable to add todo", error);
}).then(resultSet -> {
if (resultSet.wasApplied()) {
promise.resolve(true);
serviceMgmt.increment("add.todo.success");
} else {
promise.resolve(false);
serviceMgmt.increment("add.todo.fail.not.added");
}
}).invokeWithReactor(reactor, Duration.ofSeconds(10)))
```
## Getting Started
#### maven
```xml
io.advantageous.reakt
reakt-guava
3.0.0.RELEASE
```
#### gradle
```java
compile 'io.advantageous.reakt:reakt-guava:3.0.0.RELEASE'
```
You can also use replay promises, all promises, any promises, and other
features of Reakt to simplify async, reactive Java development.
Reakt gets used by [QBit](http://advantageous.github.io/qbit/), and Conekt.
#### Related projects
* [QBit Reactive Microservices](http://advantageous.github.io/qbit/)
* [Reakt Reactive Java](http://advantageous.github.io/reakt)
* [Reakt Guava Bridge](http://advantageous.github.io/reakt-guava/)
* [QBit Extensions](https://github.com/advantageous/qbit-extensions)
* [Elekt Consul](http://advantageous.github.io/elekt-consul/)
* [Elekt](http://advantageous.github.io/elekt/)
* [Reactive Microservices](http://www.mammatustech.com/reactive-microservices)
* [AWS Cassandra Support](http://cloudurable.com/subscription_support_benefits_cassandra/index.html)
* [More specific Cassandra Reakt integration](https://github.com/advantageous/reakt-cassandra)