com.yelstream.topp.furnace.reactive.integration.StreamPublisher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of topp-furnace-reactive-integration Show documentation
Show all versions of topp-furnace-reactive-integration Show documentation
Topp Furnace Reactive Integration provides interactions between selected reactive frameworks.
The newest version!
package com.yelstream.topp.furnace.reactive.integration;
import java.util.concurrent.Flow.Publisher;
import java.util.concurrent.Flow.Subscriber;
public class StreamPublisher implements Publisher {
private final java.util.stream.Stream stream;
public StreamPublisher(java.util.stream.Stream stream) {
this.stream = stream;
}
@Override
public void subscribe(Subscriber super T> subscriber) {
stream.forEach(subscriber::onNext);
subscriber.onComplete();
}
}