Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate UnaryPromiseNotifier #11653

Merged
merged 1 commit into from Sep 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,7 +24,7 @@
import io.netty.util.collection.IntObjectMap.PrimitiveEntry;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.UnaryPromiseNotifier;
import io.netty.util.concurrent.PromiseNotifier;
import io.netty.util.internal.EmptyArrays;
import io.netty.util.internal.UnstableApi;
import io.netty.util.internal.logging.InternalLogger;
Expand Down Expand Up @@ -128,7 +128,7 @@ public Future<Void> close(final Promise<Void> promise) {
} else if (promise instanceof ChannelPromise && ((ChannelFuture) closePromise).isVoid()) {
closePromise = promise;
} else {
closePromise.addListener(new UnaryPromiseNotifier<Void>(promise));
PromiseNotifier.cascade(closePromise, promise);
}
} else {
closePromise = promise;
Expand Down
Expand Up @@ -19,6 +19,11 @@
import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.InternalLoggerFactory;

/**
*
* @deprecated use {@link PromiseNotifier#cascade(boolean, Future, Promise)}.
*/
@Deprecated
public final class UnaryPromiseNotifier<T> implements FutureListener<T> {
private static final InternalLogger logger = InternalLoggerFactory.getInstance(UnaryPromiseNotifier.class);
private final Promise<? super T> promise;
Expand Down
6 changes: 3 additions & 3 deletions handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java
Expand Up @@ -41,7 +41,7 @@
import io.netty.util.NetUtil;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.concurrent.ImmediateEventExecutor;
import io.netty.util.concurrent.UnaryPromiseNotifier;
import io.netty.util.concurrent.PromiseNotifier;
import io.netty.util.internal.ResourcesUtil;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
Expand Down Expand Up @@ -1053,8 +1053,8 @@ public void handlerAdded(ChannelHandlerContext ctx) {
// through we just want to verify the local failure condition. This way we don't have to worry
// about verifying the payload and releasing the content on the server side.
if (failureExpected) {
ctx.write(ctx.alloc().buffer(1).writeByte(1))
.addListener(new UnaryPromiseNotifier<Void>(clientWritePromise));
ChannelFuture f = ctx.write(ctx.alloc().buffer(1).writeByte(1));
PromiseNotifier.cascade(f, clientWritePromise);
}
}

Expand Down