Skip to content

Commit 13fa261

Browse files
committed
a word about Resque.push
1 parent 4373b5c commit 13fa261

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/resque.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ def inline=(inline)
137137

138138
# Pushes a job onto a queue. Queue name should be a string and the
139139
# item should be any JSON-able Ruby object.
140+
#
141+
# Resque works generally expect the `item` to be a hash with the following
142+
# keys:
143+
#
144+
# class - The String name of the job to run.
145+
# args - An Array of arguments to pass the job. Usually passed
146+
# via `class.to_class.perform(*args)`.
147+
#
148+
# Example
149+
#
150+
# Resque.push('archive', :class => 'Archive', :args => [ 35, 'tar' ])
151+
#
152+
# Returns nothing
140153
def push(queue, item)
141154
watch_queue(queue)
142155
redis.rpush "queue:#{queue}", encode(item)

0 commit comments

Comments
 (0)