io.rsocket.internal.BaseDuplexConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rsocket-core Show documentation
Show all versions of rsocket-core Show documentation
Core functionality for the RSocket library
package io.rsocket.internal;
import io.rsocket.DuplexConnection;
import reactor.core.publisher.Mono;
import reactor.core.publisher.MonoProcessor;
public abstract class BaseDuplexConnection implements DuplexConnection {
private MonoProcessor onClose = MonoProcessor.create();
public BaseDuplexConnection() {
onClose.doFinally(s -> doOnClose()).subscribe();
}
protected abstract void doOnClose();
@Override
public final Mono onClose() {
return onClose;
}
@Override
public final void dispose() {
onClose.onComplete();
}
@Override
public final boolean isDisposed() {
return onClose.isDisposed();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy