Skip to content

Refactor RequestQueue and Expose in EsploraExplorer Constructor#10

Merged
landabaso merged 1 commit intomainfrom
queue-expose
Jul 23, 2024
Merged

Refactor RequestQueue and Expose in EsploraExplorer Constructor#10
landabaso merged 1 commit intomainfrom
queue-expose

Conversation

@landabaso
Copy link
Member

Overview

This PR introduces a major refactor of the RequestQueue and exposes it as a configurable parameter in the EsploraExplorer constructor. The changes aim to improve error handling and provide more control over request queue management in Esplora clients.

Key Changes

  1. RequestQueue Refactor:

    • Added checks and thresholds for soft errors (HTTP 429, 50x) and hard errors.
    • Implemented a conservative approach by preventing new tasks from being added to the queue while handling errors.
    • Introduced parameters for configuring the RequestQueue, including:
      • maxAttemptsForSoftErrors
      • maxAttemptsForHardErrors
    • Added a function to generate randomized throttle times to avoid synchronized retry attempts.
  2. EsploraExplorer Constructor:

    • Updated the EsploraExplorer constructor to accept RequestQueueParams.
    • Integrated the refactored RequestQueue into the EsploraExplorer instance.
  3. Configuration Updates:

    • Adjusted constants and configuration for regtest, blockstream, and mempool space environments.
  4. Tests and Fixtures:

    • Enhanced test coverage.
  5. Version Bump:

    • Updated package version to 0.3.0 to reflect the significant internal changes and improvements.

- Refactor RequestQueue to include soft/hard error checks and thresholds.
- Introduce conservative approach by not adding new tasks to the queue during error states.
- Expose RequestQueue in the EsploraExplorer constructor with customizable parameters.
- Update EsploraExplorer to use instance-specific RequestQueue.
- Enhance test coverage.
- Bump version to 0.3.0 to reflect significant internal changes.
@landabaso landabaso merged commit 2fff553 into main Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant