8000 Document AHC 2.1 changes · NullP0inter/async-http-client@d4a7f88 · GitHub
[go: up one dir, main page]

Skip to content

Commit d4a7f88

Browse files
committed
Document AHC 2.1 changes
1 parent dd45929 commit d4a7f88

File tree

3 files changed

+16
-57
lines changed

3 files changed

+16
-57
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## From 2.0 to 2.1
2+
3+
* AHC 2.1 targets Netty 4.1.
4+
* `org.asynchttpclient.HttpResponseHeaders` was dropped in favor of `io.netty.handler.codec.http.HttpHeaders`.
5+
* `org.asynchttpclient.cookie.Cookie` was dropped in favor of `io.netty.handler.codec.http.cookie.Cookie` as AHC's cookie parsers were contributed to Netty.
6+
* AHC now has a RFC6265 `CookieStore` that is enabled by default. Implementation can be changed in `AsyncHttpClientConfig`.
7+
* `AsyncHttpClient` now exposes stats with `getClientStats`.
8+
* `AsyncHandlerExtensions` was dropped in favor of default methods in `AsyncHandler`.
9+
* `WebSocket` and `WebSocketListener` methods were renamed to mention frames
10+
* `AsyncHttpClientConfig#isAggregateWebSocketFrameFragments` now lets you disable WebSocket fragmented frames aggregation

MIGRATION.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ import static org.asynchttpclient.Dsl.*;
155155
import org.asynchttpclient.*;
156156
import io.netty.handler.codec.http.HttpHeaders;
157157

158-
Future<Integer> f = asyncHttpClient.prepareGet("http://www.example.com/")
158+
Future<Integer> whenStatusCode = asyncHttpClient.prepareGet("http://www.example.com/")
159159
.execute(new AsyncHandler<Integer>() {
160160
private Integer status;
161161
@Override
@@ -180,7 +180,7 @@ Future<Integer> f = asyncHttpClient.prepareGet("http://www.example.com/")
180180
}
181181
});
182182

183-
Integer statusCode = f.get();
183+
Integer statusCode = whenStatusCode.get();
184184
```
185185

186186
#### Using Continuations
@@ -190,13 +190,13 @@ Beware that canceling this `CompletableFuture` won't properly cancel the ongoing
190190
There's a very good chance we'll return a `CompletionStage` instead in the next release.
191191

192192
```java
193-
CompletableFuture<Response> promise = asyncHttpClient
193+
CompletableFuture<Response> whenResponse = asyncHttpClient
194194
.prepareGet("http://www.example.com/")
195195
.execute()
196196
.toCompletableFuture()
197197
.exceptionally(t -> { /* Something wrong happened... */ } )
198-
.thenApply(resp -> { /* Do something with the Response */ return resp; });
199-
promise.join(); // wait for completion
198+
.thenApply(response -> { /* Do something with the Response */ return resp; });
199+
whenResponse.join(); // wait for completion
200200
```
201201

202202
You may get the complete maven project for this simple demo from [org.asynchttpclient.example](https://github.com/AsyncHttpClient/async-http-client/tree/master/example/src/main/java/org/asynchttpclient/example)
@@ -213,7 +213,7 @@ WebSocket websocket = c.prepareGet("ws://demos.kaazing.com/echo")
213213

214214
@Override
215215
public void onOpen(WebSocket websocket) {
216-
websocket.sendTextMessage("...").sendMessage("...");
216+
websocket.sendTextFrame("...").sendMessage("...");
217217
}
218218

219219
@Override

0 commit comments

Comments
 (0)
0