All Downloads are FREE. Search and download functionalities are using the official Maven repository.

reactivefeign.publisher.ResponsePublisherHttpClient Maven / Gradle / Ivy

package reactivefeign.publisher;


import reactivefeign.client.ReactiveHttpClient;
import reactivefeign.client.ReactiveHttpRequest;
import reactor.core.publisher.Mono;

/**
 * Wraps {@link PublisherHttpClient}
 *
 * @author Sergii Karpenko
 */
public class ResponsePublisherHttpClient implements PublisherHttpClient {

	private final ReactiveHttpClient reactiveHttpClient;

	public ResponsePublisherHttpClient(ReactiveHttpClient reactiveHttpClient) {
		this.reactiveHttpClient = reactiveHttpClient;
	}

	@Override
	public Mono executeRequest(ReactiveHttpRequest request) {
		return Mono.defer(() -> reactiveHttpClient.executeRequest(request));
	}
}