File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Javaslang Plugin for Microserver
2
2
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 )
4
4
5
5
This plugin
6
6
35
35
36
36
## Examples
37
37
38
- JavaslangPipes
38
+ ### JavaslangPipes
39
39
40
40
``` java
41
41
@@ -50,7 +50,7 @@ JavaslangPipes
50
50
51
51
```
52
52
53
- Simple App with Javaslang Lists and Sets
53
+ ### Simple App with Javaslang Lists and Sets
54
54
55
55
``` java
56
56
@Microserver
@@ -116,3 +116,25 @@ Running the app and browsing to http://localhost:8080/javaslang-app/javaslang/pi
116
116
}
117
117
}
118
118
```
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
+
You can’t perform that action at this time.
0 commit comments