com.yelstream.topp.furnace.reactive.integration.SubscriberToIterableExample0 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;
public class SubscriberToIterableExample0 {
public static void main(String[] args) {
Flow.Subscriber subscriber = new SubscriberToIterable0<>();
// Assuming you have a Publisher instance
Flow.Publisher publisher = new SimplePublisher0();
publisher.subscribe(subscriber);
// Cast back to access the iterable functionality
Iterable iterable = (SubscriberToIterable0) subscriber;
// Iterate over the items
for (Integer item : iterable) {
System.out.println("Item from iterable: " + item);
}
}
}