1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Tiny documentation improvements [ci skip]

This commit is contained in:
Robin Dupret 2014-10-31 19:46:43 +01:00
parent c1a118abc4
commit aeb431a6ca
3 changed files with 8 additions and 11 deletions

View file

@ -48,8 +48,8 @@ module ActiveJob
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 @@ module ActiveJob
end
end
end

View file

@ -22,7 +22,7 @@ module ActiveJob
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 @@ module ActiveJob
# rescue_from(ErrorLoadingSite) do
# retry_job queue: :low_priority
# end
#
# def perform(*args)
# # raise ErrorLoadingSite if cannot scrape
# end

View file

@ -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.