Skip to content

Interface to allow alternative persistence strategy #60

@lulalala

Description

@lulalala

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions