Merged
Conversation
Contributor
There was a problem hiding this comment.
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>
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.
Changed