
net.cassite.f.stream.SimplePublisher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of f Show documentation
Show all versions of f Show documentation
a library to write async vert.x code similar as using java syntax
The newest version!
package net.cassite.f.stream;
import org.jetbrains.annotations.NotNull;
public class SimplePublisher implements Publisher {
private final Stream stream = new Stream<>();
SimplePublisher() {
}
@SuppressWarnings("unchecked")
public void publish(T data) {
stream.emit(data);
}
public void fail(@NotNull Throwable t) {
if (t == null)
throw new NullPointerException();
stream.fail(t);
}
@SuppressWarnings("unchecked")
@Override
public Stream subscribe() {
return stream.subscribe();
}
@Override
public boolean isClosed() {
return stream.isClosed();
}
@Override
public void addCloseHandler(Runnable handler) {
stream.addCloseHandler(handler);
}
@Override
public void close() {
stream.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy