Completes ActiveRecord::Batches.find_each example [ci skip]
The previous paragraph mentions that you can hand off the same processing queue to multiple workers. This completes the following example below it.
This commit is contained in:
parent
e3962308e7
commit
7afde4bbd2
@ -47,7 +47,12 @@ module Batches
|
||||
# handle from 10000 and beyond by setting the +:start+ and +:finish+
|
||||
# option on each worker.
|
||||
#
|
||||
# # Let's process from record 10_000 on.
|
||||
# # In worker 1, let's process until 9999 records.
|
||||
# Person.find_each(finish: 9_999) do |person|
|
||||
# person.party_all_night!
|
||||
# end
|
||||
#
|
||||
# # In worker 2, let's process from record 10_000 and onwards.
|
||||
# Person.find_each(start: 10_000) do |person|
|
||||
# person.party_all_night!
|
||||
# end
|
||||
|
Loading…
Reference in New Issue
Block a user