Skip to content

Commit 14398a1

Browse files
committed
update readme.md
1 parent 418df20 commit 14398a1

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

micro-javaslang/readme.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Javaslang Plugin for Microserver
22

3-
[micro-javaslang example apps](https://github.com/aol/micro-server/tree/master/micro-javslang/src/test/java/app)
3+
[micro-javaslang example apps]https://github.com/aol/micro-server/tree/master/micro-javaslang/src/test/java/app)
44

55
This plugin
66

@@ -35,7 +35,7 @@ Gradle
3535

3636
## Examples
3737

38-
JavaslangPipes
38+
### JavaslangPipes
3939

4040
```java
4141

@@ -50,7 +50,7 @@ JavaslangPipes
5050

5151
```
5252

53-
Simple App with Javaslang Lists and Sets
53+
### Simple App with Javaslang Lists and Sets
5454

5555
```java
5656
@Microserver
@@ -116,3 +116,25 @@ Running the app and browsing to http://localhost:8080/javaslang-app/javaslang/pi
116116
}
117117
}
118118
```
119+
120+
### For comphrension example
121+
122+
Javaslang List and JDK8 CompletableFuture
123+
124+
```java
125+
public void cfList(){
126+
127+
CompletableFuture<String> future = CompletableFuture.supplyAsync(this::loadData);
128+
CompletableFuture<List<String>> results1 = Do.add(future)
129+
.add(List.of("first","second"))
130+
.yield( loadedData -> localData-> loadedData + ":" + localData )
131+
.unwrap();
132+
133+
System.out.println(results1.join());
134+
135+
}
136+
private String loadData(){
137+
return "loaded";
138+
}
139+
```
140+

0 commit comments

Comments
 (0)