Skip to content

Commit

Permalink
Merge b3c39d0 into 139ac1e
Browse files Browse the repository at this point in the history
  • Loading branch information
emmmile committed Nov 16, 2018
2 parents 139ac1e + b3c39d0 commit 9478ebf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion README.md
Expand Up @@ -19,6 +19,7 @@ Guava's ListenableFuture class
### Runtime dependencies
* Java 8 or higher
* Guava 21.0 or higher
* Google [`api-common`](https://mvnrepository.com/artifact/com.google.api/api-common) from `com.google.api`

### Usage

Expand All @@ -28,7 +29,7 @@ To import it with maven, use this:
<dependency>
<groupId>com.spotify</groupId>
<artifactId>futures-extra</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
</dependency>

### Examples
Expand Down Expand Up @@ -199,3 +200,17 @@ CompletableFuture<V> completable = CompletableFuturesExtra.toCompletableFuture(l
CompletableFuture<V> completable = getFuture();
ListenableFuture<V> listenable = CompletableFuturesExtra.toListenableFuture(completable);
```

* From `ApiFuture` to JDK 8 `CompletableFuture` (especially useful when using [Google client libraries](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients))

```java
ApiFuture<V> apiFuture = getFuture();
CompletableFuture<V> completable = CompletableFuturesExtra.toCompletableFuture(apiFuture);
```

* From JDK 8 `CompletableFuture` to `ApiFuture` (especially useful when using [Google client libraries](https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients))

```java
CompletableFuture<V> completable = getFuture();
ApiFuture<V> apiFuture = CompletableFuturesExtra.toApiFuture(completable);
```
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -71,8 +71,8 @@
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.35.0</version>
<artifactId>api-common</artifactId>
<version>1.7.0</version>
</dependency>

<!-- test dependencies -->
Expand Down

0 comments on commit 9478ebf

Please sign in to comment.