Conversation
…djust related documentation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request changes the default behavior of the wait parameter from True to False across the fspin library, making fire-and-forget (non-blocking) execution the default for both async and threaded sync functions. This is a breaking change that affects the spin decorator, context manager, and related rate control utilities.
Key changes:
- Changed default
waitparameter toFalsefor non-blocking execution by default - Updated documentation and examples to reflect the new default behavior
- Added comprehensive test coverage for thread joining and blocking behavior
- Enhanced test infrastructure with timeout enforcement to prevent infinite hangs
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fspin/decorators.py | Updates spin decorator to use wait=False default and handle thread joining logic |
| fspin/spin_context.py | Changes context manager to accept and forward wait parameter with new default |
| fspin/rate_control.py | Implements thread joining logic when wait=True and updates async wrapper default |
| fspin_cheatsheet.md | Updates documentation to reflect new default wait=False behavior |
| tests/*.py | Adds new tests for blocking behavior and updates existing tests to explicitly use wait=True |
| pytest.ini | Adds timeout configuration to prevent infinite test hangs |
| example/*.py | Updates examples to explicitly specify wait=True for blocking behavior |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This pull request updates the
waitparameter behavior for thespindecorator, context manager, and related rate control utilities to make non-blocking execution the default for both async and threaded sync functions. It also improves documentation and test coverage to reflect these changes, ensuring clearer and more predictable blocking semantics for users.Core API changes:
waitparameter toFalsein thespindecorator, context manager, and related methods, making fire-and-forget (non-blocking) the default for async and threaded sync functions. Blocking execution now requires explicitly passingwait=True. [1] [2] [3] [4] [5]RateControl.start_spinning_syncandRateControl.start_spinning_async_wrapperto correctly handle the newwaitsemantics, including proper thread joining and task awaiting whenwait=True. [1] [2] [3] [4]Documentation updates:
waitparameter and explain blocking/non-blocking modes for both async and sync threaded functions. [1] [2] [3]Test improvements:
wait=Truewhere blocking behavior is required, and added new tests to verify correct blocking and thread joining for both decorator and direct usage of threaded sync functions. [1] [2] [3] [4] [5] [6] [7]Other enhancements:
Internal codebase changes:
waitparameter and ensure backward compatibility. [1] [2]