sidekiq_send_to_worker 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +58 -0
- data/Rakefile +34 -0
- data/lib/sidekiq_send_to_worker/sender.rb +13 -0
- data/lib/sidekiq_send_to_worker/version.rb +3 -0
- data/lib/sidekiq_send_to_worker.rb +4 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 22cced10f424926ec47580f526f1ee51621239ef
|
4
|
+
data.tar.gz: 197022f56066d73250097729f56131572714688f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 930638b6169fdf135597a2da495bb8ac22d3d5c75d3c096e46dd67d4a2ee2e1486d49fc35b0c43ca655843951b483770fbcca4a5a0fbbd5ffb2e223a92bda51e
|
7
|
+
data.tar.gz: 17c387b18968a228783760d1eaa47db513171fb04fbe981c5f47c9f6b322ca0e9398aad975abf916e95884e9bd4aed88149f436cd73da7cb6e2d08ed33621e9f
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Muhammet
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Sidekiq Send To Worker
|
2
|
+
|
3
|
+
This gem provides enqueue jobs from another projects
|
4
|
+
|
5
|
+
## Installing
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'sidekiq_runner'
|
9
|
+
gem 'sidekiq_send_to_worker'
|
10
|
+
```
|
11
|
+
|
12
|
+
### Example
|
13
|
+
```ruby
|
14
|
+
# Your worker
|
15
|
+
class UrlShortenerWorker
|
16
|
+
include Sidekiq::Worker
|
17
|
+
|
18
|
+
sidekiq_options backtrace: true, queue: 'url_shortener', retry: 2
|
19
|
+
|
20
|
+
include SidekiqRunner::SidekiqPerform
|
21
|
+
|
22
|
+
def create_from_google(params)
|
23
|
+
# id = params[:id]
|
24
|
+
# Video.find(id)
|
25
|
+
# Do something here
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_from_bitly(params)
|
29
|
+
# id = params[:id]
|
30
|
+
# Video.find(id)
|
31
|
+
# Do something here
|
32
|
+
end
|
33
|
+
|
34
|
+
def my_other_method
|
35
|
+
# Do something here
|
36
|
+
end
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
|
41
|
+
Send Job To Workers
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
SidekiqSendToWorker::Sender.perform('UrlShortenerWorker', 'create_from_google', {a:1, b:2} )
|
45
|
+
```
|
46
|
+
|
47
|
+
## Running Tests
|
48
|
+
|
49
|
+
$ bundle install
|
50
|
+
$ bundle exec rake test
|
51
|
+
|
52
|
+
If you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit `test/support/test_helper.rb` and tell the tests where the gem is checked out.
|
53
|
+
|
54
|
+
## Code Status
|
55
|
+
|
56
|
+
* [![Travis CI]()]()
|
57
|
+
* [![Gem Version]()]()
|
58
|
+
* [![Dependencies]()]()
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'SidekiqSendToWorker'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module SidekiqSendToWorker
|
2
|
+
class Sender
|
3
|
+
include Sidekiq::Worker
|
4
|
+
sidekiq_options backtrace: true, queue: 'send_to_worker', retry: 1
|
5
|
+
|
6
|
+
include SidekiqRunner::SidekiqPerform
|
7
|
+
|
8
|
+
def perform(worker_name, method_name, args)
|
9
|
+
SidekiqRunner::Runner.enqueue(worker_name, method_name, args)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sidekiq_send_to_worker
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Muhammet
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sidekiq
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4'
|
41
|
+
description: Enqueue job from another projects
|
42
|
+
email:
|
43
|
+
- dilekmuhammet@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- lib/sidekiq_send_to_worker.rb
|
52
|
+
- lib/sidekiq_send_to_worker/sender.rb
|
53
|
+
- lib/sidekiq_send_to_worker/version.rb
|
54
|
+
homepage: https://github.com/movielala/sidekiq_send_to_worker
|
55
|
+
licenses:
|
56
|
+
- MIT
|
57
|
+
metadata: {}
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 2.4.5.1
|
75
|
+
signing_key:
|
76
|
+
specification_version: 4
|
77
|
+
summary: Enqueue job from another projects
|
78
|
+
test_files: []
|