com.github.thorbenkuck.network.stream.Sink Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easy-net Show documentation
Show all versions of easy-net Show documentation
An EventStream driven, simple to use Client/Server framework
The newest version!
package com.github.thorbenkuck.network.stream;
import java.util.function.Consumer;
public interface Sink {
static Sink of(Consumer consumer) {
return new SimpleSink<>(consumer);
}
default void attachTo(EventStream extends T> eventStream) {
eventStream.subscribe(this::push);
}
void push(T t);
}