Skip to content

Commit

Permalink
Write README
Browse files Browse the repository at this point in the history
  • Loading branch information
minkimcello committed Dec 17, 2024
1 parent 044d299 commit 1a5f5e2
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion retry-backoff/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# retry-backoff

WIP
Retry operations with incremental backoff.

---

There's a default timeout set to 30 seconds. If you'd like to set a different
timeout, you'll need to either pass in options to `useRetryWithBackoff`:

```ts
import { main } from "effection";
import { useRetryWithBackoff } from "@effection-contrib/retry-backoff";
import { myOperation } from "./myOperation";

await main(function* () {
yield* useRetryWithBackoff(myOperation, { timeout: 45_000 });
});
```

Or initialize the context so that the same timeout can be applied to all of your
retry operations:

```ts
import { main } from "effection";
import {
initRetryWithBackoff,
useRetryWithBackoff,
} from "@effection-contrib/retry-backoff";
import { myOperation } from "./myOperation";

await main(function* () {
yield* initRetryWithBackoff({ timeout: 45_000 });
yield* retryWithBackoff(myOperation);
});
```

0 comments on commit 1a5f5e2

Please sign in to comment.