Skip to content

AC-240 Restructures RequestQueue to be a trait, adds a non-batching variant - #7802

Open
thesuzerain wants to merge 8 commits into
mainfrom
Ads-client-avoid-batching
Open

thesuzerain wants to merge 8 commits into
mainfrom
Ads-client-avoid-batching

Conversation

@thesuzerain

@thesuzerain thesuzerain commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation: Based on this comment, we will start without request batching and have a simple queue to start. Currently though, RequestQueue is designed around batching. So we want to have an alternate version that does not that we can switch between when we are ready/running a test.

This turns RequestQueue into a trait, the batching version into an implementation of said trait, and adds a simple queue version as well (basic FIFO, no batching).

There are fewer LoC here then it seems- a lot of it is because code is moved around.

No breaking changes here. BackgroundWorker does not exist yet.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@thesuzerain thesuzerain changed the title Ads Client: Restructures RequestQueue to be a trait, adds a non-batching variant AC-240 Restructures RequestQueue to be a trait, adds a non-batching variant Nov 19, 2026
@thesuzerain
thesuzerain marked this pull request as ready for review November 19, 2026 21:22
@thesuzerain
thesuzerain requested a review from a team as a code owner November 19, 2026 21:22

// Thread sleep delay to wait for new requests to queue before resolving them.
// This must be a very short amount of time to ensure ads are requested near-immediately on startup.
pub const BATCH_GATHER_DURATION_DEFAULT: Duration = Duration::from_millis(100);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for this now defaulting and being settable in new(), the rename, and some tests remaining in request.rs, this file is the same as request.rs used to be.

This branch has not been deployed

No deployments
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