All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.datakernel.csp.RecyclingChannelConsumer Maven / Gradle / Ivy

Go to download

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