Skip to content

Commit

Permalink
update readme.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
areyouok committed Feb 6, 2018
1 parent 8a00400 commit 3534433
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ userCache.computeIfAbsent(1234567L, (key) -> loadUserFromDataBase(1234567L));
## advanced API
Asynchronous API:
```java
CompletionStage<ResultData> future = cache.GET(userId).future();
future.thenAccept(resultData -> {
System.out.println(resultData.getData());
CacheGetResult r = cache.GET(userId);
CompletionStage<ResultData> future = r.future();
future.thenRun(() -> {
if(r.isSuccess()){
System.out.println(r.getValue());
}
});
```

Expand Down

0 comments on commit 3534433

Please sign in to comment.