我正在使用Spring Flux。 我需要从不同的来源组装一个Object。 我怎样才能确定两个流都返回了所需的数据?
像:
public Mono<MyObject> createMyObject() {
MyObject myObject = new MyObject();
someService.getSomeData().subscribe(myObject::setData);
oneMoreService.getMoreData().subscribe(list -> {
// myObject populate more fields
});
// how can I be sure that someData and moreData is populated, before we reach doSomeBusinessStuff method?
return Mono.just(myObject);
}
public Result doSomeBusinessStuff(Mono<MyObject> myObject) {
// make some other calculations with someData and moreData
}
答案 0 :(得分:3)
你可以拉链。
Dim ws As Worksheet
Dim str2 As Variant
Dim arr2() As String
Dim j As Long
Dim rng As Range
Set ws = Sheets("Main")
Set Tbl = Sheet2.ListObjects("DataTable")
Set rng = Range("A1:AG1") 'Need to change
j = 1
For Each cell In rng
str2 = cell.Value
ReDim Preserve arr2(j)
arr2(j) = str2
j = j + 1
Next cell
Tbl.Range.AutoFilter Field:=12, Criteria1:=arr2, Operator:=xlFilterValues
End sub
您可以在文档中找到有关它的信息。 https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html#zip-reactor.core.publisher.Mono-reactor.core.publisher.Mono-