Skip to content

Commit a4f10c2

Browse files
committed
v2.2
1 parent bd93d9d commit a4f10c2

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,41 @@ Include this package as a dependency in your project. Note: This package is publ
6666
<dependency>
6767
<groupId>com.amilesend</groupId>
6868
<artifactId>tvmaze-java-client</artifactId>
69-
<version>2.1.5</version>
69+
<version>2.2</version>
7070
</dependency>
7171
```
7272

7373
## Recipes
7474

7575
### Instantiation
7676

77+
Default:
7778
```java
7879
TvMaze client = new TvMaze();
7980
SearchApi searchApi = client.getSearchApi();
8081
List<ShowResult> results = searchApi.searchShows("friends");
8182
```
8283

84+
With a RetryStrategy:
85+
```java
86+
TvMaze client = new TvMaze(new DefaultConnectionBuilder()
87+
.httpClient(new OkHttpClient())
88+
.baseUrl(TvMaze.API_URL)
89+
.userAgent(TvMaze.USER_AGENT)
90+
.authManager(new NoOpAuthManager())
91+
.gsonFactory(new GsonFactory())
92+
.isGzipContentEncodingEnabled(true)
93+
// Options are ExponentialDelayRetryStrategy, FixedDelayRetryStrategy
94+
// or NoRetryStrategy (default).
95+
.retryStrategy(ExponentialDelayRetryStrategy.builder()
96+
.baseDelayMs(500L)
97+
.maxJitterMs(100L)
98+
.maxAttempts(3)
99+
.maxTotalDelayMs(2000L)
100+
.build())
101+
.build());
102+
103+
```
83104
### Customizing the HTTP client configuration
84105

85106
<details>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<groupId>com.amilesend</groupId>
2727
<artifactId>tvmaze-java-client</artifactId>
28-
<version>2.1.6-SNAPSHOT</version>
28+
<version>2.2</version>
2929

3030
<name>tvmaze-java-client</name>
3131
<description>A client to access the TVMaze API</description>

src/main/java/com/amilesend/tvmaze/client/TvMaze.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
@RequiredArgsConstructor
4040
public class TvMaze {
41-
public static final String USER_AGENT = "TvMazeJavaClient/2.1";
41+
public static final String USER_AGENT = "TvMazeJavaClient/2.2";
4242
public static final String API_URL = "https://api.tvmaze.com";
4343

4444
private final Connection<GsonFactory> connection;

0 commit comments

Comments
 (0)