Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev authored and lxbzmy committed Mar 26, 2022
1 parent 2ca17df commit 6163ce8
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2021 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.
Expand All @@ -24,10 +24,13 @@
*
* <p>For example:
* <pre class="code">
* ExchangeFunction exchangeFunction = ExchangeFunctions.create(new ReactorClientHttpConnector());
* ClientRequest request = ClientRequest.create(HttpMethod.GET, URI.create("https://example.com/resource")).build();
* ExchangeFunction exchangeFunction =
* ExchangeFunctions.create(new ReactorClientHttpConnector());
*
* Mono&lt;String&gt; result = exchangeFunction
* URI url = URI.create("https://example.com/resource");
* ClientRequest request = ClientRequest.create(HttpMethod.GET, url).build();
*
* Mono&lt;String&gt; bodyMono = exchangeFunction
* .exchange(request)
* .flatMap(response -> response.bodyToMono(String.class));
* </pre>
Expand All @@ -39,15 +42,15 @@
public interface ExchangeFunction {

/**
* Exchange the given request for a response mono.
* Exchange the given request for a {@link ClientResponse} promise.
* @param request the request to exchange
* @return the delayed response
*/
Mono<ClientResponse> exchange(ClientRequest request);

/**
* Filters this exchange function with the given {@code ExchangeFilterFunction}, resulting in a
* filtered {@code ExchangeFunction}.
* Filter the exchange function with the given {@code ExchangeFilterFunction},
* resulting in a filtered {@code ExchangeFunction}.
* @param filter the filter to apply to this exchange
* @return the filtered exchange
* @see ExchangeFilterFunction#apply(ExchangeFunction)
Expand Down

0 comments on commit 6163ce8

Please sign in to comment.