feat(distribution-probe): add onProgress callback to probeMany#527
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
probeManygains an optionalonProgress(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
onProgress?: (completed, total) => voidonProbeManyOptions.probeManywraps the per-probe task so the callback fires after eachprobe()resolves, counting completions (not result position, since results resolve in input order but tasks settle out of order). The genericmapHostLimitedscheduler is untouched.Notes
totaltimes; never called for an empty batch.Tests
Added:
onProgressticks once per probe ending at(total, total); not called for an empty batch. Full@lde/distribution-probesuite green (91 tests), typecheck clean.