Skip to content

Commit

Permalink
New native support for end to end reactive streaming through the reac…
Browse files Browse the repository at this point in the history
…tive-assembler-core and reactive-assembler-flux modules
  • Loading branch information
pellse committed Sep 25, 2020
1 parent 78d257d commit 3aa15b0
Show file tree
Hide file tree
Showing 15 changed files with 1,229 additions and 1 deletion.
25 changes: 25 additions & 0 deletions reactive-assembler-core/.gitignore
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/
12 changes: 12 additions & 0 deletions reactive-assembler-core/build.gradle
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}"
}
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);
}
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);
}

0 comments on commit 3aa15b0

Please sign in to comment.