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

com.yelstream.topp.furnace.reactive.integration.SubscriberToIterableExample 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 SubscriberToIterableExample {
    public static void main(String[] args) {
        Flow.Subscriber subscriber = new SubscriberToIterable<>();

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

        // Cast back to access the iterable functionality
        Iterable iterable = (SubscriberToIterable) subscriber;

        // Iterate over the items as they arrive
        for (Integer item : iterable) {
            System.out.println("Item from iterable: " + item);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy