Skip to content

Commit 216b2f6

Browse files
authored
Merge pull request #6 from codepath/rogerh/add-timeout
Add setTimeout() for default
2 parents e5ea001 + 5f3505e commit 216b2f6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To use this library, add the following to your `.gradle` file:
1717

1818
```gradle
1919
dependencies {
20-
implementation 'com.codepath.libraries:asynchttpclient:2.1.0'
20+
implementation 'com.codepath.libraries:asynchttpclient:2.1.1'
2121
}
2222
```
2323

Diff for: library/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ext {
1111
POM_DESC = "Async Http Client wrapper using OkHttp"
1212
POM_SCM_URL = 'https://github.com/codepath/AsyncHttpClient'
1313
BASE_VERSION = 2
14-
VERSION_NAME = "2.1.0"
14+
VERSION_NAME = "2.1.1"
1515
}
1616

1717
version = VERSION_NAME

Diff for: library/src/main/java/com/codepath/asynchttpclient/AsyncHttpClient.java

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public AsyncHttpClient(OkHttpClient client) {
3333
okHttpClient = client;
3434
}
3535

36+
// to support previous API
37+
public void setTimeout(int timeout) {
38+
okHttpClient.newBuilder().readTimeout(timeout, TimeUnit.SECONDS).connectTimeout(timeout, TimeUnit.SECONDS);
39+
}
40+
3641
public void setReadTimeout(int timeout) {
3742
okHttpClient.newBuilder().readTimeout(timeout, TimeUnit.SECONDS);
3843
}

0 commit comments

Comments
 (0)