提交 aeb431a6 编写于 作者: R Robin Dupret

Tiny documentation improvements [ci skip]

上级 c1a118ab
......@@ -48,8 +48,8 @@ def set(options={})
end
end
# Creates a new job instance. Takes as arguments the arguments that
# will be passed to the perform method.
# Creates a new job instance. Takes the arguments that will be
# passed to the perform method.
def initialize(*arguments)
@arguments = arguments
@job_id = SecureRandom.uuid
......@@ -84,6 +84,3 @@ def deserialize_arguments(serialized_args)
end
end
end
......@@ -22,7 +22,7 @@ def job_or_instantiate(*args)
end
end
# Reschedule the job to be re-executed. This is useful in combination
# Reschedules the job to be re-executed. This is useful in combination
# with the +rescue_from+ option. When you rescue an exception from your job
# you can ask Active Job to retry performing your job.
#
......@@ -37,6 +37,7 @@ def job_or_instantiate(*args)
# rescue_from(ErrorLoadingSite) do
# retry_job queue: :low_priority
# end
#
# def perform(*args)
# # raise ErrorLoadingSite if cannot scrape
# end
......
......@@ -172,15 +172,15 @@ end
# environment
```
If you want more control on what queue a job will be run you can pass a :queue
option to #set:
If you want more control on what queue a job will be run you can pass a `:queue`
option to `#set`:
```ruby
MyJob.set(queue: :another_queue).perform_later(record)
```
To control the queue from the job level you can pass a block to queue_as. The
block will be executed in the job context (so you can access self.arguments)
To control the queue from the job level you can pass a block to `#queue_as`. The
block will be executed in the job context (so you can access `self.arguments`)
and you must return the queue name:
```ruby
......@@ -202,7 +202,6 @@ end
ProcessVideoJob.perform_later(Video.last)
```
NOTE: Make sure your queueing backend "listens" on your queue name. For some
backends you need to specify the queues to listen to.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册