Skip to content

Commit 3d84b36

Browse files
author
Stephane Landelle
committed
Revert back README changes as they can't be displayed as lon as AHC2 is not released
1 parent 50d63f4 commit 3d84b36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Then in your code you can simply do ([Javadoc](http://sonatype.github.com/async-
2424
import com.ning.http.client.*;
2525
import java.util.concurrent.Future;
2626

27-
AsyncHttpClient asyncHttpClient = AsyncHttpClientFactory.getAsyncHttpClient();
27+
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
2828
Future<Response> f = asyncHttpClient.prepareGet("http://www.ning.com/").execute();
2929
Response r = f.get();
3030
```
@@ -37,7 +37,7 @@ You can also accomplish asynchronous (non-blocking) operation without using a Fu
3737
import com.ning.http.client.*;
3838
import java.util.concurrent.Future;
3939

40-
AsyncHttpClient asyncHttpClient = AsyncHttpClientFactory.getAsyncHttpClient();
40+
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
4141
asyncHttpClient.prepareGet("http://www.ning.com/").execute(new AsyncCompletionHandler<Response>(){
4242

4343
@Override
@@ -62,7 +62,7 @@ You can also mix Future with AsyncHandler to only retrieve part of the asynchron
6262
import com.ning.http.client.*;
6363
import java.util.concurrent.Future;
6464

65-
AsyncHttpClient asyncHttpClient = AsyncHttpClientFactory.getAsyncHttpClient();
65+
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
6666
Future<Integer> f = asyncHttpClient.prepareGet("http://www.ning.com/").execute(
6767
new AsyncCompletionHandler<Integer>(){
6868

@@ -89,7 +89,7 @@ which is something you want to do for large responses: this way you can process
8989
import com.ning.http.client.*;
9090
import java.util.concurrent.Future;
9191

92-
AsyncHttpClient c = AsyncHttpClientFactory.getAsyncHttpClient();
92+
AsyncHttpClient c = new AsyncHttpClient();
9393
Future<String> f = c.prepareGet("http://www.ning.com/").execute(new AsyncHandler<String>() {
9494
private ByteArrayOutputStream bytes = new ByteArrayOutputStream();
9595

@@ -140,7 +140,7 @@ Finally, you can also configure the AsyncHttpClient via its AsyncHttpClientConfi
140140
```java
141141
AsyncHttpClientConfig cf = new AsyncHttpClientConfig.Builder()
142142
S.setProxyServer(new ProxyServer("127.0.0.1", 38080)).build();
143-
AsyncHttpClient c = AsyncHttpClientFactory.getAsyncHttpClient(cf);
143+
AsyncHttpClient c = new AsyncHttpClient(cf);
144144
```
145145

146146
## WebSocket
@@ -176,7 +176,7 @@ The library uses Java non blocking I/O for supporting asynchronous operations. T
176176

177177
```java
178178
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().build();
179-
AsyncHttpClient client = AsyncHttpClientFactory.getAsyncHttpClient(new GrizzlyAsyncHttpProvider(config), config);
179+
AsyncHttpClient client = new AsyncHttpClient(new GrizzlyAsyncHttpProvider(config), config);
180180
```
181181

182182
## User Group

0 commit comments

Comments
 (0)