Hi, I am currently using maintenance_tasks with Shoryuken.
It appears that the job-iteration gem does not currently define an interruption_adapter for Shoryuken. Can we add one?
I have made a PR with it, but I can't push to the repo. The code is something like this:
# frozen_string_literal: true
begin
require "shoryuken"
rescue LoadError
# Shoryuken is not available, no need to load the adapter
return
end
begin
# Lifecycle event registration (Shoryuken.configure_server / config.on) was
# introduced in Shoryuken 2.0.2.
gem("shoryuken", ">= 2.0.2")
rescue Gem::LoadError
warn("job-iteration's interruption adapter for Shoryuken requires Shoryuken 2.0.2 or newer")
return
end
module JobIteration
module InterruptionAdapters
module ShoryukenAdapter
class << self
attr_accessor :stopping
def call
stopping
end
end
Shoryuken.configure_server do |config|
config.on(:shutdown) do
ShoryukenAdapter.stopping = true
end
end
end
register(:shoryuken, ShoryukenAdapter)
end
end
The rest of the code is quite simple:
- Add shoryuken in
interruption_adapters.rb BUNDLED_ADAPTERS array.
- Update CHANGELOG and README
- Add shoryuken to the Gemfile
How can I contribute? Thanks in advance
Hi, I am currently using maintenance_tasks with Shoryuken.
It appears that the job-iteration gem does not currently define an interruption_adapter for Shoryuken. Can we add one?
I have made a PR with it, but I can't push to the repo. The code is something like this:
The rest of the code is quite simple:
interruption_adapters.rbBUNDLED_ADAPTERS array.How can I contribute? Thanks in advance