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

com.yelstream.topp.furnace.reactive.integration.SubscriberToStreamExample 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;

public class SubscriberToStreamExample {
    public static void main(String[] args) {
        Flow.Subscriber subscriber = new SubscriberToStream0<>();

        // Assuming you have a Publisher instance
        Flow.Publisher publisher = new SimplePublisher0();
        publisher.subscribe(subscriber);

        // Cast back to access the stream functionality
        SubscriberToStream0 streamConverter = (SubscriberToStream0) subscriber;

        // Use the stream
        streamConverter.stream()
                .forEach(item -> System.out.println("Item from stream: " + item));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy