coney_island 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coney_island/job.rb +11 -2
- data/lib/coney_island/version.rb +1 -1
- data/test/dummy/log/test.log +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3fb478c2730e9e2d56b20d44bb396bcb301451
|
4
|
+
data.tar.gz: 12d601f5f1b12d36411fc4a5feef23fcb16f15de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fbfce656d1425476b82e91b3b6bc3fb81fbe065d2378e05142d34b0be29d857d1b49bdef9357ab761d73dcee55f675c6454ce86b750f1e3170c476c22c688f2
|
7
|
+
data.tar.gz: 2ccc1e34070456caeaecc55b4f7f87469eda7e959824cbf0f42898c4932cb4f2a23183e9ceea708ef20ce431f26e47b414fb82ba293b15a79eafbd19f33d2468
|
data/lib/coney_island/job.rb
CHANGED
@@ -17,6 +17,9 @@ module ConeyIsland
|
|
17
17
|
@class_name = args['klass']
|
18
18
|
@klass = @class_name.constantize
|
19
19
|
@method_args = args['args']
|
20
|
+
if @method_args.is_a? Hash # The whole args is keyword args
|
21
|
+
@method_args.symbolize_keys!
|
22
|
+
end
|
20
23
|
# Symbolize hash keys for consistency and keyword arguments
|
21
24
|
@method_args.each { |v| v.symbolize_keys! if v.is_a?(Hash) } if !!@method_args
|
22
25
|
@attempts = args['attempt_count'] || 1
|
@@ -58,8 +61,14 @@ module ConeyIsland
|
|
58
61
|
end
|
59
62
|
|
60
63
|
def execute_job_method
|
61
|
-
if method_args.present?
|
62
|
-
|
64
|
+
if method_args.present? && method_args.length > 0
|
65
|
+
# The whole args is keyword args, just pass it as is
|
66
|
+
if method_args.is_a? Hash
|
67
|
+
object.send method_name, method_args
|
68
|
+
else
|
69
|
+
# Splat the array into args
|
70
|
+
object.send method_name, *method_args
|
71
|
+
end
|
63
72
|
else
|
64
73
|
object.send method_name
|
65
74
|
end
|
data/lib/coney_island/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1709,3 +1709,22 @@ Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
|
1709
1709
|
Submitting job : [TestModel, :add_to_list, {:args=>[[]], :work_queue=>"my-queue"}]
|
1710
1710
|
Submitting job 07326aa1-477a-4a3f-99fe-5b2f3092bfc4: [TestModel, :add_to_list, {:args=>[[]]}]
|
1711
1711
|
Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
1712
|
+
Submitting job 11fab165-0f82-435d-8eac-0f59e9ae6573: [TestModel, :add_to_list, {:args=>[[]]}]
|
1713
|
+
Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
1714
|
+
Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
1715
|
+
ConeyIsland::Submitter.handle_connection connecting...
|
1716
|
+
Failed to connecto to RabbitMQ Attempt #1 time(s), trying again in 0 seconds...
|
1717
|
+
ConeyIsland::Submitter.handle_connection connecting...
|
1718
|
+
Submitting job : [DummyPerformer, :perform, {:args=>nil}]
|
1719
|
+
Submitting job : [DummyPerformer, :perform, {:args=>nil, :work_queue=>"bar"}]
|
1720
|
+
Submitting job : [MyPerformer, :add_to_list, {:work_queue=>"boardwalk", :args=>[[]], :delay=>0}]
|
1721
|
+
Submitting job : [MyPerformer, :perform, {:args=>[], :delay=>0}]
|
1722
|
+
Submitting job : [MyInheritedPerformer, :perform, {:args=>[], :delay=>0}]
|
1723
|
+
Submitting job MyHighlander-increment: [MyHighlander, "increment", {:args=>[], :highlander=>true}]
|
1724
|
+
ConeyIsland::Submitter.handle_connection connecting...
|
1725
|
+
Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
1726
|
+
Submitting job : [TestModel, :add_to_list, {:args=>[[]], :work_queue=>"my-queue"}]
|
1727
|
+
Submitting job : [TestModel, :add_to_list, {:args=>[[]]}]
|
1728
|
+
Submitting job : [MyPerformer, "set_color", {:instance_id=>7, :args=>["sage"], :highlander=>false}]
|
1729
|
+
Submitting job : [MySingleton, "perform", {:singleton=>true, :args=>["interesting stuff"], :highlander=>false}]
|
1730
|
+
Submitting job : [MyPerformer, "set_tone", {:args=>["contemplative"], :highlander=>false}]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coney_island
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|