Polishing
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* Reactor-Netty implementation of {@link ClientHttpConnector}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
* @see reactor.netty.http.client.HttpClient
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,6 +38,7 @@ import org.springframework.http.ZeroCopyHttpOutputMessage;
|
||||
* {@link ClientHttpRequest} implementation for the Reactor-Netty HTTP client.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
* @see reactor.netty.http.client.HttpClient
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.springframework.util.MultiValueMap;
|
||||
* {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.0
|
||||
* @see reactor.netty.http.client.HttpClient
|
||||
*/
|
||||
@@ -66,7 +67,7 @@ class ReactorClientHttpResponse implements ClientHttpResponse {
|
||||
/**
|
||||
* Constructor that matches the inputs from
|
||||
* {@link reactor.netty.http.client.HttpClient.ResponseReceiver#responseConnection(BiFunction)}.
|
||||
* @since 5.3
|
||||
* @since 5.2.8
|
||||
*/
|
||||
public ReactorClientHttpResponse(HttpClientResponse response, Connection connection) {
|
||||
this.response = response;
|
||||
@@ -77,7 +78,7 @@ class ReactorClientHttpResponse implements ClientHttpResponse {
|
||||
|
||||
/**
|
||||
* Constructor with inputs extracted from a {@link Connection}.
|
||||
* @deprecated as of 5.2.8
|
||||
* @deprecated as of 5.2.8, in favor of {@link #ReactorClientHttpResponse(HttpClientResponse, Connection)}
|
||||
*/
|
||||
@Deprecated
|
||||
public ReactorClientHttpResponse(HttpClientResponse response, NettyInbound inbound, ByteBufAllocator alloc) {
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.util.Assert;
|
||||
* and is expected typically to be declared as a Spring-managed bean.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Brian Clozel
|
||||
* @since 5.1
|
||||
*/
|
||||
public class ReactorResourceFactory implements InitializingBean, DisposableBean {
|
||||
@@ -97,8 +98,8 @@ public class ReactorResourceFactory implements InitializingBean, DisposableBean
|
||||
*/
|
||||
public void addGlobalResourcesConsumer(Consumer<HttpResources> consumer) {
|
||||
this.useGlobalResources = true;
|
||||
this.globalResourcesConsumer = this.globalResourcesConsumer != null ?
|
||||
this.globalResourcesConsumer.andThen(consumer) : consumer;
|
||||
this.globalResourcesConsumer = (this.globalResourcesConsumer != null ?
|
||||
this.globalResourcesConsumer.andThen(consumer) : consumer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,8 +222,7 @@ public class ReactorResourceFactory implements InitializingBean, DisposableBean
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (this.useGlobalResources) {
|
||||
HttpResources.disposeLoopsAndConnectionsLater(
|
||||
this.shutdownQuietPeriod, this.shutdownTimeout).block();
|
||||
HttpResources.disposeLoopsAndConnectionsLater(this.shutdownQuietPeriod, this.shutdownTimeout).block();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user