Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilio Del Tessandoro committed Nov 16, 2018
1 parent 01c04dd commit b3c39d0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
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);
```

0 comments on commit b3c39d0

Please sign in to comment.