Support Shoryuken
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start by inspecting the bundled adapters and registration points in interruption_adapters.rb, then compare the proposed Shoryuken lifecycle handling with existing adapters. Update interruption_adapters.rb, the Gemfile, CHANGELOG, and README; done means Shoryuken is registered as a bundled adapter and the dependency and usage are documented.
Written by the indexing model from the issue text.
Description
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.rbBUNDLED_ADAPTERS array. - Update CHANGELOG and README
- Add shoryuken to the Gemfile
How can I contribute? Thanks in advance
- Dominant language
- Ruby
- Stars
- 1.3k
- Forks
- 61
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/job-iteration
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
Shopify/job-iteration#220 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 55/100
Shopify/job-iteration#672 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Shopify/job-iteration#615 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Shopify/job-iteration#614 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Shopify/job-iteration#587 ·
All issues in Shopify/job-iteration
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100