Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 35b52a4

Browse files
minor clean up
1 parent 529214e commit 35b52a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ asyncHttpClient.prepareGet("http://www.example.com/").execute(new AsyncCompletio
7070
Alternatively you may use continuations (through Java 8 class `CompletableFuture<T>`) to accomplish asynchronous (non-blocking) solution. The equivalent continuation approach to the previous example is:
7171

7272
```java
73+
import static org.asynchttpclient.Dsl.*;
74+
7375
import org.asynchttpclient.*;
7476
import java.util.concurrent.CompletableFuture;
7577

76-
import static org.asynchttpclient.Dsl.asyncHttpClient;
77-
7878
AsyncHttpClient asyncHttpClient = asyncHttpClient();
7979
CompletableFuture<Response> promise = asyncHttpClient
8080
.prepareGet("http://www.example.com/")
@@ -117,10 +117,12 @@ which is something you want to do for large responses: this way you can process
117117
You have full control on the Response life cycle, so you can decide at any moment to stop processing what the server is sending back:
118118

119119
```java
120+
import static org.asynchttpclient.Dsl.*;
121+
120122
import org.asynchttpclient.*;
121123
import java.util.concurrent.Future;
122124

123-
AsyncHttpClient c = newDefaultAsyncHttpClient();
125+
AsyncHttpClient c = asyncHttpClient();
124126
Future<String> f = c.prepareGet("http://www.example.com/").execute(new AsyncHandler<String>() {
125127
private ByteArrayOutputStream bytes = new ByteArrayOutputStream();
126128

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /