All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yelstream.topp.furnace.reactive.integration.StreamPublisher Maven / Gradle / Ivy

Go to download

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 subscriber) {
        stream.forEach(subscriber::onNext);
        subscriber.onComplete();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy