gaffneyc / sunspot-queue

Background search indexing using existing worker systems
MIT License
35 stars 37 forks source link

Job class should be configurable #4

Closed gaffneyc closed 11 years ago

gaffneyc commented 12 years ago

The provided IndexJob and RemovalJob should be good for most situations but the meat is SessionProxy. Let people use indexing / removal jobs that fit their use case better.

zdennis commented 11 years ago

+1

zdennis commented 11 years ago

The above change-set allows the default index/removal jobs for resque and sidekiq to be overridden via the following syntax:

Sunspot::Queue.configure do |c|
  c.resque_index_job = MyCustomIndexJob
  c.resque_removal_job = MyCustomRemovalJob
  c.sidekiq_index_job = MySidekiqIndexJob
  c.sidekiq_removal_job = MySidekidRemovalJob
end

Or without a block accessing the configuration object directly:

Sunspot::Queue.configuration.resque_index_job = MyCustomIndexJob

There are default jobs provided based on what was being used.

gaffneyc commented 11 years ago

Covered by #8, thanks again @zdennis.