
io.datakernel.csp.RecyclingChannelConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datakernel-csp Show documentation
Show all versions of datakernel-csp Show documentation
Communicating sequential process via channels, similar to Golang's channels.
A channel could be imagine as a pipe which connects some processes.
The newest version!
package io.datakernel.csp;
import io.datakernel.common.Recyclable;
import io.datakernel.promise.Promise;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class RecyclingChannelConsumer implements ChannelConsumer {
@Override
public @NotNull Promise accept(@Nullable Recyclable value) {
if (value != null) {
value.recycle();
}
return Promise.complete();
}
@Override
public void close(@NotNull Throwable e) {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy