fractaledmind / litestream-ruby

MIT License
71 stars 6 forks source link

Add Puma plugin #22

Closed zachasme closed 3 months ago

zachasme commented 4 months ago

Possible solution for #3.

This adds a Puma plugin, in the same way Solid Queue provides one. Enabled using:

# in config/puma.rb
plugin :litestream if rails_env == "production"

which makes it simple to deploy with Kamal for example

fractaledmind commented 4 months ago

@zachasme I really like this! To get this ready for release I think we need a few more things:

One question after studying the Solid Queue implementation is whether or not the monitor_puma background thread is important. Do you have an opinion on that? My gut instinct it to copy their implementation fully, but I'm open to additional thoughts.

zachasme commented 4 months ago

Great! I'll fix the linter issues and add README section. And I think we should go with your instinct to copy the full implementation (the initial commit was just the bit I extracted to make it work on my own projects).

I'll have to think about how to make an integration test for the plugin, though.

fractaledmind commented 4 months ago

@zachasme Please rebase main to get the CI fix