Skip to content
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

Use Chewy.thread_local_data to access Thread.current #803

Closed
wants to merge 1 commit into from

Conversation

bolshakov
Copy link

@bolshakov bolshakov commented Jul 16, 2021

Currently, it's dangerous to use Chewy with dry-effects, because it runs fibers that reset Thread local state. This PR isolates thread-local variables access, so it could be easily extended.

After isolating them, we can provide dry-effects integration.

See dry-rb/dry-effects#82 for the details.

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the changelog if the new code introduces user-observable changes. See changelog entry format for details.

Having `Thread.current` access isolated help to extend chewy. After isolating it we can provide dry-effects integration.
@bolshakov bolshakov self-assigned this Jul 16, 2021
@bolshakov bolshakov marked this pull request as ready for review July 16, 2021 10:37
@bolshakov bolshakov added WIP and removed WIP labels Jul 16, 2021
@bolshakov bolshakov closed this Jul 16, 2021
@bolshakov bolshakov deleted the isolate-glabal-state branch July 16, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant