com.jauntsdn.rsocket.internal.BaseDuplexConnection Maven / Gradle / Ivy
package com.jauntsdn.rsocket.internal;
import com.jauntsdn.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