Skip to content

feat(distribution-probe): add onProgress callback to probeMany#527

Merged
ddeboer merged 1 commit into
mainfrom
feat/probe-many-onprogress
Jun 26, 2026
Merged

feat(distribution-probe): add onProgress callback to probeMany#527
ddeboer merged 1 commit into
mainfrom
feat/probe-many-onprogress

Conversation

@ddeboer

@ddeboer ddeboer commented Jun 26, 2026

Copy link
Copy Markdown
Member

What

probeMany gains an optional onProgress(completed, total) callback, fired once after each probe settles and ending at (total, total).

Why

It lets a caller drive a determinate progress indicator while a large batch runs — the total (distinct probe targets) is known up front, and each settle is a tick. The motivating consumer is the NDE Dataset Register: validating a catalogue with many distributions on one host can take a while (especially with the per-host concurrency cap throttling the burst), and today the UI just hangs. This is the foundation for a progress bar there.

How

  • New onProgress?: (completed, total) => void on ProbeManyOptions.
  • probeMany wraps the per-probe task so the callback fires after each probe() resolves, counting completions (not result position, since results resolve in input order but tasks settle out of order). The generic mapHostLimited scheduler is untouched.

Notes

  • Order reflects completion, not input order; fires total times; never called for an empty batch.
  • A throwing callback rejects the batch (documented), so it is meant to be cheap and side-effect-only.
  • Additive, optional — non-breaking.

Tests

Added: onProgress ticks once per probe ending at (total, total); not called for an empty batch. Full @lde/distribution-probe suite green (91 tests), typecheck clean.

probeMany now accepts an optional onProgress(completed, total) callback, fired once after each probe settles and ending at (total, total). It lets a caller drive a determinate progress indicator while a large batch runs, e.g. the Dataset Register reporting validation progress for a catalogue with many distributions.
@ddeboer
ddeboer merged commit 2eab82d into main Jun 26, 2026
2 checks passed
@ddeboer
ddeboer deleted the feat/probe-many-onprogress branch June 26, 2026 10:36
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