sidekiq_async_task 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: dc24c7c3bb1497874303bca7ca0c8f251bd79ce8e9afb1371cd5c97caa99b428
4
+ data.tar.gz: 29b3fa21dab4816c476cb096445537216778547a8d15967d0f1fcf9fdb2cf463
5
+ SHA512:
6
+ metadata.gz: d681d8fc92fb9dd643ab3f27803c008393029cd3a253455b51e9c8aefe74414b8f7b0686137800afa16e40723ab66070b085b54e40968a3bbd2cc96846ee99b2
7
+ data.tar.gz: dca581af5d54ff95e9cb23fc2e08eaf4ae796e13d59520249a4af0e20ba6569b3eddea8dc68b7386d1bf2a53628f613548f41dc00d3eb8eb94f70fe2e51003ef
Binary file
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,3 @@
1
+ SimpleCov.start do
2
+ add_group "lib", "lib"
3
+ end
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4.0
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at karunk@live.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in sidekiq_async_task.gemspec
6
+ gemspec
@@ -0,0 +1,111 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sidekiq_async_task (0.1.0)
5
+ activerecord
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (5.2.3)
11
+ actionview (= 5.2.3)
12
+ activesupport (= 5.2.3)
13
+ rack (~> 2.0)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (5.2.3)
18
+ activesupport (= 5.2.3)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
23
+ activemodel (5.2.3)
24
+ activesupport (= 5.2.3)
25
+ activerecord (5.2.3)
26
+ activemodel (= 5.2.3)
27
+ activesupport (= 5.2.3)
28
+ arel (>= 9.0)
29
+ activesupport (5.2.3)
30
+ concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ i18n (>= 0.7, < 2)
32
+ minitest (~> 5.1)
33
+ tzinfo (~> 1.1)
34
+ arel (9.0.0)
35
+ builder (3.2.3)
36
+ byebug (11.0.1)
37
+ concurrent-ruby (1.1.5)
38
+ crass (1.0.4)
39
+ database_cleaner (1.7.0)
40
+ diff-lcs (1.3)
41
+ docile (1.3.1)
42
+ erubi (1.8.0)
43
+ generator_spec (0.9.4)
44
+ activesupport (>= 3.0.0)
45
+ railties (>= 3.0.0)
46
+ i18n (1.6.0)
47
+ concurrent-ruby (~> 1.0)
48
+ json (2.2.0)
49
+ loofah (2.2.3)
50
+ crass (~> 1.0.2)
51
+ nokogiri (>= 1.5.9)
52
+ method_source (0.9.2)
53
+ mini_portile2 (2.4.0)
54
+ minitest (5.11.3)
55
+ nokogiri (1.10.2)
56
+ mini_portile2 (~> 2.4.0)
57
+ rack (2.0.7)
58
+ rack-test (1.1.0)
59
+ rack (>= 1.0, < 3)
60
+ rails-dom-testing (2.0.3)
61
+ activesupport (>= 4.2.0)
62
+ nokogiri (>= 1.6)
63
+ rails-html-sanitizer (1.0.4)
64
+ loofah (~> 2.2, >= 2.2.2)
65
+ railties (5.2.3)
66
+ actionpack (= 5.2.3)
67
+ activesupport (= 5.2.3)
68
+ method_source
69
+ rake (>= 0.8.7)
70
+ thor (>= 0.19.0, < 2.0)
71
+ rake (10.5.0)
72
+ rspec (3.8.0)
73
+ rspec-core (~> 3.8.0)
74
+ rspec-expectations (~> 3.8.0)
75
+ rspec-mocks (~> 3.8.0)
76
+ rspec-core (3.8.0)
77
+ rspec-support (~> 3.8.0)
78
+ rspec-expectations (3.8.2)
79
+ diff-lcs (>= 1.2.0, < 2.0)
80
+ rspec-support (~> 3.8.0)
81
+ rspec-mocks (3.8.0)
82
+ diff-lcs (>= 1.2.0, < 2.0)
83
+ rspec-support (~> 3.8.0)
84
+ rspec-support (3.8.0)
85
+ simplecov (0.16.1)
86
+ docile (~> 1.1)
87
+ json (>= 1.8, < 3)
88
+ simplecov-html (~> 0.10.0)
89
+ simplecov-html (0.10.2)
90
+ sqlite3 (1.4.0)
91
+ thor (0.20.3)
92
+ thread_safe (0.3.6)
93
+ tzinfo (1.2.5)
94
+ thread_safe (~> 0.1)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ bundler (~> 1.10)
101
+ byebug
102
+ database_cleaner
103
+ generator_spec
104
+ rake (~> 10.0)
105
+ rspec
106
+ sidekiq_async_task!
107
+ simplecov
108
+ sqlite3
109
+
110
+ BUNDLED WITH
111
+ 1.17.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Karun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # SidekiqAsyncTask
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sidekiq_async_task`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'sidekiq_async_task'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install sidekiq_async_task
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sidekiq_async_task. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the SidekiqAsyncTask project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/sidekiq_async_task/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "sidekiq_async_task"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,17 @@
1
+ class CreateAsyncTask < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :async_tasks do |t|
4
+ t.string :task_name, null: false
5
+ t.string :job_id
6
+ t.integer :perform_after
7
+ t.json :payload
8
+ t.datetime :started_at
9
+ t.datetime :completed_at
10
+ t.string :state, default: :scheduled, null: false
11
+ t.string :external_hash
12
+ t.integer :retry_count, default: 0
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,22 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module SidekiqAsyncTask
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+ desc "Add the migrations for AsyncTask"
8
+ source_root File.expand_path("./install/templates", __dir__)
9
+
10
+ def self.next_migration_number(path)
11
+ next_migration_number = current_migration_number(path) + 1
12
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
13
+ end
14
+
15
+ def copy_migrations
16
+ migration_template "create_async_task.rb",
17
+ "db/migrate/create_async_task.rb"
18
+ end
19
+
20
+ end
21
+ end
22
+
@@ -0,0 +1,12 @@
1
+ require 'active_record'
2
+
3
+ require 'sidekiq_async_task/version'
4
+
5
+ require 'sidekiq_async_task/async_task'
6
+
7
+ require 'sidekiq_async_task/async_job_scheduler'
8
+
9
+ require 'sidekiq_async_task/transaction_support'
10
+
11
+ # Generators
12
+ require 'generators/sidekiq_async_task/install_generator'
@@ -0,0 +1,28 @@
1
+ # Wrapper around sidekiq to make job scheduling transactional.
2
+ # Provides wrapper methods - perform_with_transaction_in and perform_with_transaction_async
3
+ # over perform_in and perform_async methods defined by sidekiq
4
+ # Creates a model named AsyncTask to store details about the job like, job_id, status, retry counts etc.
5
+ # When the transaction (inside which job is scheduled) is successfull, the task is schedules as a sidekiq job
6
+ # But in case of an exception, when Rollback is encountered, it doesn't schedule the job.
7
+ module SidekiqAsyncTask
8
+ module AsyncJobScheduler
9
+
10
+ def perform_with_transaction_in( perform_after, *args )
11
+ AsyncTask.create_job(self.inspect, args, perform_after.to_i)
12
+ end
13
+
14
+ def perform_with_transaction_at( perform_at_time, *args )
15
+ difference = perform_at_time - Time.now
16
+ AsyncTask.create_job(self.inspect, args, difference.to_i)
17
+ end
18
+
19
+ def perform_with_transaction_async(*args)
20
+ AsyncTask.create_job(self.inspect, args)
21
+ end
22
+
23
+ def perform_with_transaction_future(perform_after, *args)
24
+ AsyncTask.create_future_job!(self.inspect, args, perform_after.to_i)
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,85 @@
1
+ # This model is used to track all AsyncTasks.
2
+ # It has four states:
3
+ # UNINITIATED : it means that only the async task has been created but no job has been pushed to queue.
4
+ # SCHEDULED (default) : jobs has been pushed to queue or will be pushed to queue after transaction commits.
5
+ # STARTED : When the job is picked up to be executed, before the main perform for the worker (perform_with_callback) is called, its state is changed to `started`.
6
+ # COMPLETED : If the job is successful, then the state is changed to `completed` otherwise, it is retried/rescheduled and the retry_count is incremented upon further processing.
7
+
8
+ module SidekiqAsyncTask
9
+ class AsyncTask < ActiveRecord::Base
10
+ attr_accessor :should_schedule_job
11
+
12
+ after_commit :schedule_job, on: :create
13
+ scope :unprocessed, lambda { where(state: :scheduled) }
14
+ scope :uninitiated, lambda { where(state: :uninitiated) }
15
+
16
+ def self.create_job(task_name, payload, perform_after = nil)
17
+ async_task = self.new(task_name: task_name, perform_after: perform_after, payload: payload, external_hash: get_external_hash)
18
+ async_task.should_schedule_job = true
19
+ async_task.save!
20
+ async_task
21
+ end
22
+
23
+ def self.create_future_job!(task_name, payload, perform_after = nil)
24
+ self.create!(state: :uninitiated, task_name: task_name, perform_after: perform_after, payload: payload, external_hash: get_external_hash)
25
+ end
26
+
27
+ def schedule_job
28
+ worker = self.task_name.constantize
29
+ if self.perform_after.present?
30
+ worker.perform_in((self.perform_after).seconds, *(self.payload), { async_external_hash: create_task_hash })
31
+ else
32
+ worker.perform_async(*(self.payload), { async_external_hash: "#{self.external_hash}__#{self.id}" })
33
+ end
34
+ rescue StandardError => e
35
+ error_data = [e.message, e.backtrace]
36
+ error_msg = "Error occurred while scheduling job in the AsyncTask with id #{self.id}. Error: #{error_data}. Please resolve immediately."
37
+ raise InternalServerError.new(msg: error_msg)
38
+ end
39
+
40
+ def create_task_hash
41
+ "#{self.external_hash}__#{self.id}"
42
+ end
43
+
44
+
45
+ def self.try_get_task_id_from_hash(task_hash)
46
+ if task_hash.is_a?(Hash) && task_hash.keys == ['async_external_hash']
47
+ task_hash, task_id = task_hash['async_external_hash'].split('__')
48
+ task = AsyncTask.find_by(id: task_id.to_i, external_hash: task_hash)
49
+ raise InternalServerError.new(msg: "Invalid Task Hash Provided") unless task.present?
50
+ task.id
51
+ end
52
+ end
53
+
54
+ def started?
55
+ self.state.to_sym == :started
56
+ end
57
+
58
+ def scheduled?
59
+ self.state.to_sym == :scheduled
60
+ end
61
+
62
+ def get_task_hask
63
+ { 'async_external_hash' => self.create_task_hash }
64
+ end
65
+
66
+ def scheduled_in_past?
67
+ (self.created_at + (self.perform_after.to_i).seconds + 1.minute) < Time.now
68
+ end
69
+
70
+ def uninitiated_in_past?
71
+ (self.updated_at + (self.perform_after.to_i).seconds + 1.minute) < Time.now
72
+ end
73
+
74
+ def uninitiated?
75
+ self.state.to_sym == :uninitiated
76
+ end
77
+
78
+ private
79
+
80
+ def self.get_external_hash
81
+ "async_external_hash_#{SecureRandom.hex}"
82
+ end
83
+
84
+ end
85
+ end
@@ -0,0 +1,74 @@
1
+ module SidekiqAsyncTask
2
+ class TransactionSupport
3
+ # Inherit any sidekiq worker from this to add support for transactional scheduling of sidekiq jobs as well
4
+ # as callback support
5
+ # To use this class, make the worker inherit from it and define the job in the
6
+ # function named perform_with_callback
7
+ # If job is called with perform_with_transaction_in, it tracks the job state in AsyncTask model
8
+ # The last arguement is task specific which is separated here and rest is passed on the worker as arguments.
9
+
10
+ extend AsyncJobScheduler
11
+ include ActiveSupport::Callbacks
12
+
13
+ attr_accessor :task_id
14
+ attr_accessor :task_rescheduled
15
+ attr_accessor :arguments
16
+
17
+ define_callbacks :perform
18
+ set_callback :perform, :after, :after_perform
19
+ set_callback :perform, :before, :before_perform
20
+
21
+ def perform( *args )
22
+ set_args_and_task(*args)
23
+ run_callbacks :perform do
24
+ perform_with_callback( *(self.arguments) )
25
+ end
26
+ end
27
+
28
+ def before_perform
29
+ if self.task_id.present?
30
+ task = AsyncTask.find_by_id(self.task_id)
31
+ if task.uninitiated? || task.scheduled?
32
+ task.update_attributes!(job_id: self.jid, state: :started, started_at: Time.now)
33
+ elsif task.started?
34
+ retry_count = task.retry_count + 1
35
+ task.update_attributes!(retry_count: retry_count)
36
+ else
37
+ raise InternalServerError.new(msg: "AsyncTask #{task.id} should not be started now.")
38
+ end
39
+ end
40
+ end
41
+
42
+ def after_perform
43
+ return if task_rescheduled == true
44
+ if self.task_id.present?
45
+ task = AsyncTask.find_by_id(self.task_id)
46
+ task.update_attributes!(state: :completed, completed_at: Time.now)
47
+ end
48
+ end
49
+
50
+ def async_reschedule_after(perform_after, *args)
51
+ self.task_rescheduled = true
52
+ if self.task_id.present?
53
+ task = AsyncTask.find_by_id(self.task_id)
54
+ self.class.perform_in(perform_after, *args, { async_external_hash: "#{task.external_hash}__#{task.id}" })
55
+ else
56
+ self.class.perform_in(perform_after, *args)
57
+ end
58
+ end
59
+
60
+ private
61
+
62
+ def set_args_and_task(*args)
63
+ task_hash = args[-1]
64
+ task_id = AsyncTask.try_get_task_id_from_hash(task_hash)
65
+ if task_id.present?
66
+ self.arguments = args[0..-2]
67
+ self.task_id = task_id
68
+ else
69
+ self.arguments = args
70
+ end
71
+ end
72
+
73
+ end
74
+ end
@@ -0,0 +1,3 @@
1
+ module SidekiqAsyncTask
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,33 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "sidekiq_async_task/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sidekiq_async_task"
8
+ spec.version = SidekiqAsyncTask::VERSION
9
+ spec.authors = ["Karun"]
10
+ spec.email = ["karunk@live.com"]
11
+
12
+ spec.summary = "A lightweight gem to ensure safe execution of asyncronous Sidekiq Jobs within a transaction in Rails in a DB backed way."
13
+ spec.description = "Making asyncronous transactional sidekiq jobs possible"
14
+ spec.homepage = "http://vkarun.me/asynctask.html"
15
+ spec.license = "MIT"
16
+
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+ spec.add_dependency 'activerecord'
25
+ spec.add_development_dependency "bundler", "~> 1.10"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "simplecov"
29
+ spec.add_development_dependency "generator_spec"
30
+ spec.add_development_dependency "byebug"
31
+ spec.add_development_dependency 'sqlite3'
32
+ spec.add_development_dependency 'database_cleaner'
33
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sidekiq_async_task
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Karun
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: generator_spec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: byebug
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: database_cleaner
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: Making asyncronous transactional sidekiq jobs possible
140
+ email:
141
+ - karunk@live.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".DS_Store"
147
+ - ".rspec"
148
+ - ".simplecov"
149
+ - ".travis.yml"
150
+ - CODE_OF_CONDUCT.md
151
+ - Gemfile
152
+ - Gemfile.lock
153
+ - LICENSE.txt
154
+ - README.md
155
+ - Rakefile
156
+ - bin/console
157
+ - bin/setup
158
+ - lib/generators/sidekiq_async_task/install/templates/create_async_task.rb
159
+ - lib/generators/sidekiq_async_task/install_generator.rb
160
+ - lib/sidekiq_async_task.rb
161
+ - lib/sidekiq_async_task/async_job_scheduler.rb
162
+ - lib/sidekiq_async_task/async_task.rb
163
+ - lib/sidekiq_async_task/transaction_support.rb
164
+ - lib/sidekiq_async_task/version.rb
165
+ - sidekiq_async_task.gemspec
166
+ homepage: http://vkarun.me/asynctask.html
167
+ licenses:
168
+ - MIT
169
+ metadata: {}
170
+ post_install_message:
171
+ rdoc_options: []
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubygems_version: 3.0.1
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: A lightweight gem to ensure safe execution of asyncronous Sidekiq Jobs within
189
+ a transaction in Rails in a DB backed way.
190
+ test_files: []