@Override
    public final void operationComplete(ChannelFuture future) throws Exception {
        // If a message has been sent out, cancel the timeout for starting a request.
        cancelTimeout();

        try (SafeCloseable ignored = RequestContextUtil.pop()) {
            if (future.isSuccess()) {
                // The first write is always the first headers, so log that we finished our first transfer
                // over the wire.
                if (!loggedRequestFirstBytesTransferred) {
                    logBuilder.requestFirstBytesTransferred();
                    loggedRequestFirstBytesTransferred = true;
                }

                if (state == State.DONE) {
                    logBuilder.endRequest();
                    // Successfully sent the request; schedule the response timeout.
                    assert responseWrapper != null;
                    responseWrapper.initTimeout();
                }

                if (state == State.NEEDS_100_CONTINUE) {
                    assert responseWrapper != null;
                    responseWrapper.initTimeout();
                }

                onWriteSuccess();
                return;
            }

            if (!loggedRequestFirstBytesTransferred) {
                fail(UnprocessedRequestException.of(future.cause()));
            } else {
                failAndReset(future.cause());
            }
        }
    }
Invoked on each write of an {@link HttpObject}.
core/src/main/java/com/linecorp/armeria/client/AbstractHttpRequestHandler.java