Skip to content

Commit

Permalink
Add sleep to Drop Emitter test bean
Browse files Browse the repository at this point in the history
  • Loading branch information
abutch3r committed Feb 22, 2024
1 parent 3e5afe3 commit 29dfac9
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ public void emitALotOfItems() {
@Outgoing("out")
public PublisherBuilder<String> consume(final PublisherBuilder<String> values) {
return values
.via(ReactiveStreams.<String>builder()
.flatMapCompletionStage(s -> CompletableFuture.supplyAsync(() -> s, executor)))
.onError(err -> downstreamFailure = err);

.via(ReactiveStreams.<String>builder().flatMapCompletionStage(s -> CompletableFuture.supplyAsync(() -> {
try {
Thread.sleep(1);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
return s;
}, executor))).onError(err -> downstreamFailure = err);
}

@Incoming("out")
Expand Down

0 comments on commit 29dfac9

Please sign in to comment.