Skip to content

Commit

Permalink
Update JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Jan 7, 2025
1 parent 65b8bcc commit 627b096
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/controller-utils/src/create-service-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@ export const DEFAULT_DEGRADED_THRESHOLD = 5_000;
* ``` ts
* class Service {
* constructor() {
* this.#policy = createServicePolicy();
* this.#policy = createServicePolicy({
* maxRetries: 3,
* maxConsecutiveFailures: 3,
* circuitBreakDuration: 5000,
* degradedThreshold: 2000,
* });
* }
*
* async fetch() {
* this.#policy.execute(async () => {
* // ...
* return await this.#policy.execute(async () => {
* const response = await fetch('https://some/url');
* return await response.json();
* });
* }
* }
Expand Down

0 comments on commit 627b096

Please sign in to comment.