tennis-jobs 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41fd5c9ff7ba286a975e7f6fd69b422564884783
4
- data.tar.gz: 02f1abfb9d8045033ab9bc8203b0d05473d4736e
3
+ metadata.gz: cbb90feec2f2e77454b97d27427725c8a742f43d
4
+ data.tar.gz: 116901e81bdb636395102e79e154b3237055b216
5
5
  SHA512:
6
- metadata.gz: 37dda9596db258dea9c2eb3787bf1b674cca4faa3b4467cca957bd646f7d6ab6e8e76ef3382d8ac9b29f3afa0d73524224094b9b32cd493106061f4e021672cc
7
- data.tar.gz: 67dddffbe9393ca3051eea299dcb95974f3a147ba31403070663fe534fce849a68752d33adf28be4a73ffe8dc2ab59478e5a2b42aec383089dea056317b0dc21
6
+ metadata.gz: 27600764daf9001be443cfea63c92933bb6dd4a0a234192fd12ed9087f8f1967df6f0f8d582ed9aedcc5e53ce7ae08a495edaefc787fc55ffb1a4df7bcdd9281
7
+ data.tar.gz: b3e4e2cf9fc030865c71b72817e4af930bfffd0ebfe92bcc21b7e4489fe629a9018e9320aac1f56f6827b6f8ebbf92d39e2b4556a53d340915329ec37eb79fe7
data/README.markdown CHANGED
@@ -45,7 +45,7 @@ command:
45
45
  The `workers` options is directly given to sneakers, it will determine the
46
46
  number of subprocesses that will handle the messages, the level of parallelism.
47
47
 
48
- The classes are the classes that will receive your `execute` or `defer` calls
48
+ The classes are the classes that will receive your `send_work` or `defer` calls
49
49
  but we'll see that later...
50
50
 
51
51
  Also it is possible to add options directly in your workers:
@@ -97,7 +97,7 @@ class MyClass
97
97
  end
98
98
  end
99
99
 
100
- MyClass.execute("my class")
100
+ MyClass.send_work("my class")
101
101
  # => Before processing
102
102
  # => Working with my class
103
103
  ```
@@ -105,7 +105,7 @@ MyClass.execute("my class")
105
105
  ### Serializers
106
106
 
107
107
  You can provide a Proc for the loader and/or the dumper keywords.
108
- The dumper will be used when calling `MyClass.execute(message)` receiving
108
+ The dumper will be used when calling `MyClass.send_work(message)` receiving
109
109
  the `message` as argument. It should return a string. The loader will be
110
110
  used when the message is poped from the RabbitMQ queue.
111
111
 
@@ -124,7 +124,7 @@ class MyClass
124
124
  end
125
125
  end
126
126
 
127
- MyClass.execute([1, "foo"])
127
+ MyClass.send_work([1, "foo"])
128
128
  # => Message is serialized and deserialized correctly
129
129
  # => one: 1, two: foo
130
130
  ```
@@ -143,7 +143,7 @@ class MyClass
143
143
  end
144
144
  end
145
145
 
146
- MyClass.execute([String, User.find(1)])
146
+ MyClass.send_work([String, User.find(1)])
147
147
  # => Classes can be passed: String - Class
148
148
  # => Active record object can be passed too: <User#1 ...>
149
149
  ```
@@ -32,6 +32,6 @@ Example.new(__FILE__, SumWorker).run do
32
32
  array = Array.new(5) { 1 + rand(5) }
33
33
  print "Press enter to enqueue a random array..." ; gets
34
34
  puts "Sending #{array.inspect} to the #{SumWorker::Worker.queue_name} queue!"
35
- SumWorker.execute(array)
35
+ SumWorker.send_work(array)
36
36
  end
37
37
 
@@ -10,7 +10,7 @@ class Tennis::Worker::Deferable::Action
10
10
  def _create_methods!
11
11
  _methods.each do |method|
12
12
  self.define_singleton_method(method) do |*arguments|
13
- @worker_class.execute([@receiver, method, arguments])
13
+ @worker_class.send_work([@receiver, method, arguments])
14
14
  end
15
15
  end
16
16
  end
@@ -37,7 +37,7 @@ module Tennis
37
37
  @_work ||= ->(_){ ack! }
38
38
  end
39
39
 
40
- def execute(message)
40
+ def send_work(message)
41
41
  message = _apply_serializer(:dump, message)
42
42
  if Tennis.config.async
43
43
  publisher_opts = worker.queue_opts.select do |opt_name, _|
data/tennis-jobs.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "tennis-jobs"
7
- spec.version = "0.2.0"
7
+ spec.version = "0.3.0"
8
8
  spec.authors = ["Nicolas ZERMATI"]
9
9
  spec.email = ["nicoolas25@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tennis-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas ZERMATI