asyncredux-retry-mixin

Retry failed AsyncRedux actions with exponential backoff in Dart/Flutter.

238|39|Updated Aug 4, 2019
One-click install
npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-retry-mixin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asyncredux-retry-mixin
Source: https://github.com/marcglasberg/async_redux/tree/main/.claude/skills/asyncredux-retry-mixin
Command: npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-retry-mixin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Retry mixin simplifies robust error handling by automatically retrying failed actions with exponential backoff, reducing boilerplate and improving resilience.

Core Features & Use Cases

  • Automatic retries: Retry failed reduce() executions with configurable delays and a maximum retry limit.
  • Exponential backoff: Delays grow multiplicatively to adapt to transient failures.
  • Unlimited retries option: Combine with UnlimitedRetries to retry indefinitely until success.

Quick Start

Add the Retry mixin to an action and implement reduce() to perform the operation. Example: class LoadDataAction extends AppAction with Retry { Future<AppState?> reduce() async { var data = await fetchData(); return state.copy(data: data); } }

Frequently Asked Questions about asyncredux-retry-mixin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically retry failed async actions in Flutter with exponential backoff?

To automatically retry failed async actions with exponential backoff in Flutter, apply the Retry mixin to your AsyncRedux action and define reduce() to throw on failure, which triggers the retry sequence. Delays grow multiplicatively based on your initialDelay and multiplier settings.

What is exponential backoff and how do I configure it for Dart state management?

Exponential backoff is a retry strategy where delays grow multiplicatively to handle transient failures. In Dart AsyncRedux, configure it through the Retry mixin using initialDelay, multiplier, maxRetries, and maxDelay parameters to control the retry timing and limits.

Can I retry failed Flutter actions indefinitely until they succeed?

Yes, you can retry failed Flutter actions indefinitely by combining the Retry mixin with the UnlimitedRetries mixin in your AsyncRedux action, which removes the maximum retry limit and continues attempting until the operation succeeds.

Does the AsyncRedux retry mixin work with other mixins like CheckInternet?

Yes, the AsyncRedux retry mixin works deterministically with other mixins like CheckInternet or NonReentrant. Combining them allows you to verify connectivity before retrying or prevent concurrent duplicate executions for safer state management.

How do I set a maximum retry limit and delay ceiling for network requests in Dart?

To set a maximum retry limit and delay ceiling for Dart network requests, use the Retry mixin's maxRetries parameter to cap attempts and the maxDelay parameter to prevent the exponential backoff delay from exceeding a specific duration.