-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New native support for end to end reactive streaming through the reac…
…tive-assembler-core and reactive-assembler-flux modules
- Loading branch information
pellse
committed
Sep 25, 2020
1 parent
78d257d
commit 3aa15b0
Showing
15 changed files
with
1,229 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.gradle | ||
/build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
.nb-gradle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ext { | ||
reactorVersion = '3.3.8.RELEASE' | ||
} | ||
|
||
dependencies { | ||
compile project(':assembler-util') | ||
|
||
testCompile project(':assembler-core').sourceSets.test.output | ||
|
||
testCompile "io.projectreactor:reactor-test:${reactorVersion}" | ||
compile "io.projectreactor:reactor-core:${reactorVersion}" | ||
} |
27 changes: 27 additions & 0 deletions
27
reactive-assembler-core/src/main/java/io/github/pellse/reactive/assembler/Assembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2018 Sebastien Pelletier | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.github.pellse.reactive.assembler; | ||
|
||
import org.reactivestreams.Publisher; | ||
|
||
/** | ||
* @param <T> Type for Top Level Entity e.g. {@code Customer} | ||
* @param <RC> Output Type e.g. {@code Stream<Transaction>} or {@code Flux<Transaction>} | ||
*/ | ||
public interface Assembler<T, RC> { | ||
RC assemble(Publisher<T> topLevelEntities); | ||
} |
33 changes: 33 additions & 0 deletions
33
...ve-assembler-core/src/main/java/io/github/pellse/reactive/assembler/AssemblerAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2018 Sebastien Pelletier | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.github.pellse.reactive.assembler; | ||
|
||
import org.reactivestreams.Publisher; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.BiFunction; | ||
import java.util.function.Function; | ||
import java.util.stream.Stream; | ||
|
||
@FunctionalInterface | ||
public interface AssemblerAdapter<T, ID, R, RC> { | ||
|
||
RC convertMapperSources(Publisher<T> topLevelEntitiesProvider, | ||
Function<Iterable<T>, Stream<Publisher<? extends Map<ID, ?>>>> mapperSourcesBuilder, | ||
BiFunction<Iterable<T>, List<Map<ID, ?>>, Stream<R>> aggregateStreamBuilder); | ||
} |
Oops, something went wrong.