README.markdown in tennis-jobs-0.2.0 vs README.markdown in tennis-jobs-0.3.0
- old
+ new
@@ -43,11 +43,11 @@
$ bundle exec tennis group1
The `workers` options is directly given to sneakers, it will determine the
number of subprocesses that will handle the messages, the level of parallelism.
-The classes are the classes that will receive your `execute` or `defer` calls
+The classes are the classes that will receive your `send_work` or `defer` calls
but we'll see that later...
Also it is possible to add options directly in your workers:
``` ruby
@@ -95,19 +95,19 @@
puts "Working with #{message}"
ack!
end
end
-MyClass.execute("my class")
+MyClass.send_work("my class")
# => Before processing
# => Working with my class
```
### Serializers
You can provide a Proc for the loader and/or the dumper keywords.
-The dumper will be used when calling `MyClass.execute(message)` receiving
+The dumper will be used when calling `MyClass.send_work(message)` receiving
the `message` as argument. It should return a string. The loader will be
used when the message is poped from the RabbitMQ queue.
``` ruby
class MyClass
@@ -122,11 +122,11 @@
puts "one: #{one}, two: #{two}"
ack!
end
end
-MyClass.execute([1, "foo"])
+MyClass.send_work([1, "foo"])
# => Message is serialized and deserialized correctly
# => one: 1, two: foo
```
``` ruby
@@ -141,10 +141,10 @@
puts "Active record object can be passed too: #{active_record_object}"
ack!
end
end
-MyClass.execute([String, User.find(1)])
+MyClass.send_work([String, User.find(1)])
# => Classes can be passed: String - Class
# => Active record object can be passed too: <User#1 ...>
```
### Helpers