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

Interface to allow alternative persistence strategy #60

Open
lulalala opened this issue Oct 28, 2021 · 0 comments
Open

Interface to allow alternative persistence strategy #60

lulalala opened this issue Oct 28, 2021 · 0 comments

Comments

@lulalala
Copy link

lulalala commented Oct 28, 2021

What do you think if we provide a common interface, so anyone can implement their own persistence strategy?

Turnout is tied too closely to the file strategy.

https://github.com/GoodGuide/maintenance-mode-gem comes into my mind. It provides the following interface:

MaintenanceMode.enable
MaintenanceMode.as_json # => { "enabled": true, "message": null }
MaintenanceMode.enable "we'll be back soon"
MaintenanceMode.as_json # => { "enabled": true, "message": "we'll be back soon" }
MaintenanceMode.enabled? # => true
MaintenanceMode.message # => "we'll be back soon"
MaintenanceMode.disable
MaintenanceMode.enabled? # => false

This would mean I can choose to indicate maintenance by flipping a switch on redis, and fetch message from the database.

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