feat: add progress_callback to wait_processed() for real-time progress monitoring#125
Draft
nayagamez wants to merge 2 commits intovolcengine:mainfrom
Draft
feat: add progress_callback to wait_processed() for real-time progress monitoring#125nayagamez wants to merge 2 commits intovolcengine:mainfrom
nayagamez wants to merge 2 commits intovolcengine:mainfrom
Conversation
733c1f5 to
77903b0
Compare
Collaborator
|
Thanks, @nayagamez but we have a concern that, we are working with server/client arch, and this PR depends on a embed mode. If one day the Queue is on a remote server, your contribution will cause fail. I suggest more decouple design on this issue. |
Collaborator
|
Another idea is that, wait_processed callback should be implemented after #115 transaction. After that, we can register a event queue for each transaction, and then you can get events for the transaction. |
Re-apply progress_callback support on upstream v0.1.17. Threads callback through: QueueManager → ResourceService → LocalClient → AsyncOpenViking → SyncOpenViking. Adds QueueStatus.total property for progress reporting. Drops settle_count (unnecessary due to enqueue-before-report_success ordering). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77903b0 to
5e0fbd3
Compare
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.
Summary
progress_callbackparameter towait_processed()throughout the client chaintotalproperty toQueueStatusfor convenient progress calculationMotivation
When
wait_processed()blocks for long-running indexing operations (e.g., hundredsof files), callers have no way to report progress to users. The internal queue status
(
pending,in_progress,processed,error_count) is already tracked but onlyreturned after completion.
This change exposes that status during the wait loop via an optional callback, enabling
callers to build accurate progress bars, logging, or monitoring dashboards.
Changes
QueueStatus: addtotalproperty (sum of all state fields)QueueManager.wait_complete(): addprogress_callbackparameter, invoked each poll iterationResourceService.wait_processed(): adapt QueueStatus → dict at boundary, thread callbackBaseClient/LocalClient/HTTPClient: update abstract signature and implementationsAsyncOpenViking/SyncOpenViking: thread parameter throughExample Usage
Test plan
QueueStatus.totalproperty returns correct sumtotalfieldAll tests in
tests/client/test_wait_progress.py(10 tests, 3 test classes).