-
Notifications
You must be signed in to change notification settings - Fork 2
Improve fiber state management in blocks #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves fiber state management by replacing thread-local variables with fiber-local variables to prevent behavior from leaking across fibers when caching is disabled within a block. Additionally, it adds support for setting the cache to an in-memory cache using true as a shorthand.
Key changes:
- Introduced a new
FiberLocalsclass to manage fiber-scoped variables with proper isolation - Refactored cache disable/enable mechanisms to use fiber locals instead of thread locals
- Added support for
support_table_cache = trueas an alias for:memorycache
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/support_table_cache/fiber_locals.rb | New utility class implementing fiber-local variable storage with mutex-based synchronization |
| lib/support_table_cache.rb | Refactored to use FiberLocals instead of Thread.current.thread_variable_*, added support for true value in cache assignment, updated testing! and cache checking logic |
| spec/support_table_cache/fiber_locals_spec.rb | Comprehensive test suite for FiberLocals covering fiber isolation, thread safety, nested blocks, and memory cleanup |
| spec/support_table_cache_spec.rb | Added test case for setting cache to memory cache using true |
| CHANGELOG.md | Added version 1.1.5 release notes documenting the fiber locals change and true cache assignment feature |
| VERSION | Bumped version from 1.1.4 to 1.1.5 |
| README.md | Added table of contents and reorganized companion gems section with tip callout |
| AGENTS.md | New file with detailed Copilot instructions for the project |
| Rakefile | Removed YARD, appraisal, and standard rake tasks |
| .github/workflows/continuous_integration.yml | Updated commands for standardrb and yard to run directly instead of via rake |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Changed