private ChannelPromise combine(ChannelFuture first, ChannelFuture second) {
        final ChannelPromise promise = channel().newPromise();
        final FutureListener<Void> listener = new FutureListener<Void>() {
            private int remaining = 2;

            @Override
            public void operationComplete(Future<Void> ignore) throws Exception {
                remaining--;
                if (remaining == 0) {
                    final Throwable firstCause = first.cause();
                    final Throwable secondCause = second.cause();

                    final Throwable combinedCause;
                    if (firstCause == null) {
                        combinedCause = secondCause;
                    } else {
                        if (secondCause != null && secondCause != firstCause) {
                            firstCause.addSuppressed(secondCause);
                        }
                        combinedCause = firstCause;
                    }
                    if (combinedCause != null) {
                        promise.setFailure(combinedCause);
                    } else {
                        promise.setSuccess();
                    }
                }
            }
        };
        first.addListener(listener);
        second.addListener(listener);
        return promise;
    }
The map which maps a request ID to its related pending response.
core/src/main/java/com/linecorp/armeria/internal/common/Http1ObjectEncoder.java