Skip to content

Commit

Permalink
Better recovery strategy in the README for folks who use this
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Feb 6, 2015
1 parent 97e831f commit 27cf40f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ To start, create a `Config` object, specifying a recovery policy:

```java
Config config = new Config()
.withRecoveryPolicy(new RecoveryPolicy()
.withMaxAttempts(20)
.withInterval(Duration.seconds(1))
.withMaxDuration(Duration.minutes(5)));
.withRecoveryPolicy(new RecoveryPolicy().withBackoff(Duration.seconds(1), Duration.seconds(30))
```

With our `config`, let's create some *recoverable* resources:
Expand Down Expand Up @@ -75,8 +72,9 @@ Lyra also supports invocation retries when a *retryable* failure occurs while cr
Config config = new Config()
.withRecoveryPolicy(RecoveryPolicies.recoverAlways())
.withRetryPolicy(new RetryPolicy()
.withBackoff(Duration.seconds(1), Duration.seconds(30))
.withMaxDuration(Duration.minutes(10)));
.withMaxAttempts(20)
.withInterval(Duration.seconds(1))
.withMaxDuration(Duration.minutes(5)));
ConnectionOptions options = new ConnectionOptions().withHost("localhost");
Connection connection = Connections.create(options, config);
Expand Down

0 comments on commit 27cf40f

Please sign in to comment.