Repository navigation
Add on_poll callback to wait_for_review in sync and async clients - #72
Closed
abhish12345 wants to merge 75 commits into
Closed
abhish12345 wants to merge 75 commits into
abhish12345 wants to merge 75 commits into
Conversation
…ining timeout and test sync callback in async client
…ll, close coroutines on expired budget, distinguish callback TimeoutError, and add timeout test
…ome on deadline expiry, record callback timeout distinction, and assert cancellation
…deadline expiry to protect classified mismatch from cancellation exceptions
…ple callback task cancellation from wait return, and add tests
…andle cancellation during async_wait, and test mutation across all modes
…udget, and assert invocation count in mutation test
…ous callbacks, and cancel/observe Futures and Tasks on budget expiry
…, record timeout winner vs callback completion, and add watchdog timeout test
…umption, and latch callback error propagation against absolute deadline
…ck exceptions, record callback completion time, and verify cancellation signaling
…e done futures, and test watchdog cleanup
…ne callback timestamp on future, and test coroutine isolation
…cellation and test classified outcome on callback timeout
…ith UNSET, close generators, and document optional sync on_poll
…ults, test pending future cancellation, and isolate watchdogs in subprocess
…n_poll contract and cancellation failure suppression, move pending future test into watchdog subprocess, and test inline callback mutation isolation
…ted futures directly, close unstarted coroutines safely, and verify suspending callback within budget
…onError, skip closed loop futures, and assert nested mutation isolation
…e exceptions before loop check, runner deadline check, and in-memory deep snapshot test
…closed before future wait, close suspended coroutines, and thorough test assertions
…ed tuples in finalization, copy memoryviews, reject unsupported mutables, and enforce safe tuple size
…ct immutable scalar types, copy container subclasses, buffer size limits, document snapshot failure modes, and in-memory stubbed watchdog
…e unstarted generators/coroutines inline, traverse private and dict slots, check multidimensional buffer nbytes, and bound timeout elapsed times
…line before coroutine validation, isolate tuple subclasses, and assert delivery order with request counts
…ining budget after setup, document copy error mismatch, and assert watchdog remaining budget
…ember checks, tuple constructor fallbacks, memoryview shape, and task creation guards
…ard, empty set attributes, memoryview cast errors, and test assertions
…e exception retrieval, bytearray subclass preservation, slot descriptor enumeration, custom tzinfo copying, and test fixtures
…length with element format and stride, isolate wrapper context from transport deadline, traverse reachable state through identity-hashed attributes for custom-hashed members, document backing buffer size limit, clarify callback cancellation precedence in docstring, and strengthen watchdog producer/wrapper teardown assertions
…ll invocation, support array.array and bytearray subclass exporters with attribute expansion and scalar shape=(), traverse custom hash dependencies through tuple elements, document cancellation during mismatch in README, and harden watchdog teardown and test assertions
…ces, instantiate array.array subclasses via __new__ with args, reject unlisted mutable class attributes, traverse custom-hash members across container graphs, validate loop ownership on detached tasks, document completion-time callback cutoffs, and harden watchdog and fixture teardowns
…for unhashable tasks, validate SDK requests in watchdog against test server, test timely future failure with clock advance before waiter resumption, track wrapper exception in case 4, document already-done future return cutoff, close rejected sync on_poll adapters, clear deadline around async_create_task, reject mutable class attrs on buffer and set subclasses, and traverse frozensets in readiness walk
…rectly await worker in case 3b, cleanup wrappers in case 4 finally, queue wrapper before cancelling in case 6b, test class-state rejection for set and buffer views, test custom hash reading deferred dict through frozenset, await waiter_coro_task whenever present in case 6, timestamp callback return for already-done futures, close fresh awaitable adapters discarded after deadline, reject frozenset subclasses with mutable class attributes, preserve layout for strided memoryviews over bytes, check backing buffer size, and collect set members in deadline-checked batches
… docstrings and README, include inline cancellation in mismatch exception list, retrieve completed task exception before loop check in detachment, use shared guard and cleanup discarded awaitables in all unstarted exits, check completion time before taking future timeout branch, resolve self-blocked custom-hash frozenset members, race worker startup against polling task in case 3b, capture and cancel callback task in case 3 finally, settle fixture in SyncCancelRaisingFuture teardown, and assert first snapshot head_commit_sha is UNSET
…entered runner in case 6b teardown, resume normal polling after reading completed on_poll future, cleanup discarded awaitables on task creation error, preserve future close hooks, verify membership of fallback-built frozensets after deferred writes, memoize frozenset clones before attribute assignment, pass current_target_id on dict key readiness check, handle None members in frozenset fallback, reject tuple subclasses with mutable class attrs, and test frozenset custom hash with deferred dict
…xternal tracking, detach futures before marker check, hold strong references to detached futures, omit close on invalid non-awaitable returns, reject mutable class attrs on datetime subclasses and custom tzinfo, defer unresolved attribute assignments in frozensets, reapply strides to empty memoryviews, preserve bytes exporter subclasses, race startup waits in cases 3 and 7, suspend async mutating callback before edits, and let overdue coroutine fail before waiter processes completion in case 4
…gth checks, memoryview strides and buffer sharing, and race condition test coverage
…xporter mutability sharing, loop-scoped detached futures cleanup, and catch late system exceptions in runner
…e, check bytes subclass length, use native byte counts for memoryview exporter, loop-scoped detached futures fallback, check cancellation before callback return validation, and improve mismatch and overdue test coverage
…ble, exact bytes size check, unhookable loop test, loop close store clearing order, bytes subclass native buffer reconstruction, baseline cancellation comparison, and documentation clarifications
…ple bytes length bound, bytes subclass memoryview exporter fallback, dictionary key lookup validation, natural pending cancellation delivery, and detached task loop close cleanup
… pre-materialization bytes bounds, mutable set membership validation, independent cancellation check, README awaitable deadline rules, and test improvements
…ng future observer removal, loop close exception draining, Case 3 bounded wait, and immutable bytes cutoff documentation
…odule builtins, doc signals and cancellation, bound Case 3b joins, observer removal, exception draining, and test fixtures
…callback unregistration, Python 3.10 cancellation tracking, frozenset subclass __dict__ alias fixtures, nested state dict lookup fixture, and mismatch callback event synchronization
…subclass dict finalization, dict source order, wait loop budget recheck, and watchdog assertions
…cancellation qualification and observation, and review head commit assertion
…rapper deadline operator, wait loop completion break, and test cleanup settling
… memoryview reconstruction, strict deadline comparison, Case 6c bounded wait, and mismatch review isolation
…cutoff, Case 6a bounded join, callback removal checks, mismatch field assertions, and ctypes write-through test
…ding future registration completion, fetch timeout propagation, and test join bounds
…covering span byte casting, multidimensional byte view preservation, already-failed exact-deadline assertion, and test quality improvements
…uction, ctypes._CFuncPtr guard, exporter slot copying, cyclic frozenset deadline checking, and bounded joins
…es span row slicing, subprocess sys import, Case 3b result check, multi-element reverse slice assertions, and controlled mismatch callback synchronization
…D ctypes physical span reconstruction, post-done deadline cutoff, README limit qualification, and test completion tying
…ry cancellation, and test quality
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
Add an optional
on_pollcallback towait_for_reviewin bothProoflineClientandAsyncProoflineClient.Problem Statement
When waiting for a review in CI/CD pipelines, CLI tools, or automated services, reviews can take several minutes to settle. Previously,
wait_for_reviewpolled silently without giving callers any visibility into intermediate assessment progress or execution states.Solution & Approach
on_poll: Callable[[CustomerReviewDetail], None] | None = NonetoProoflineClient.wait_for_review.on_poll: Callable[[CustomerReviewDetail], Awaitable[None] | None] | None = NonetoAsyncProoflineClient.wait_for_review, supporting both sync callbacks and async coroutines seamlessly.Verification & Testing
tests/test_http.py(test_wait_for_review_invokes_on_poll_callback) verifying callback execution in both sync and async clients against the mock HTTP server.pytest(all tests passing).mypyandruff(no type or lint errors).Development Prompts