com.yelstream.topp.furnace.reactive.integration.SimplePublisher0 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;
import java.util.concurrent.Flow.Subscription;
public class SimplePublisher0 implements Publisher {
@Override
public void subscribe(Subscriber super Integer> subscriber) {
subscriber.onSubscribe(new Subscription() {
@Override
public void request(long n) {
for (int i = 1; i <= 5; i++) {
subscriber.onNext(i);
}
subscriber.onComplete();
}
@Override
public void cancel() {
// Handle cancellation
}
});
}
}