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

Suggest to use a class instead of a global variable for a Rails application #160

Open
januszm opened this issue Nov 14, 2021 · 1 comment

Comments

@januszm
Copy link

januszm commented Nov 14, 2021

The README suggests that you assign the Rollout.new instance to the global variable $rollout. This is not generally recommended for Rails applications, discouraged by Rubocop, and mostly because of thread safety and for a few other reasons, if I remember correctly. Why not suggest something like this for a Rails application?

# config/initializers/rollout.rb
Feature = Rollout.new(Redis.current).freeze
# ...
# somewhere else
Feature.active? :chat
@januszm
Copy link
Author

januszm commented Dec 16, 2022

Could someone confirm that this gem is thread safe in multithreaded, production environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant