Class: ThinkingSphinx::Deltas::ResqueDelta
- Inherits:
-
DefaultDelta
- Object
- DefaultDelta
- ThinkingSphinx::Deltas::ResqueDelta
- Defined in:
- lib/thinking_sphinx/deltas/resque_delta.rb
Overview
Delayed Deltas for Thinking Sphinx, using Resque.
This documentation is aimed at those reading the code. If you’re looking for a guide to Thinking Sphinx and/or deltas, I recommend you start with the Thinking Sphinx site instead - or the README for this library at the very least.
Defined Under Namespace
Constant Summary collapse
- JOB_PREFIX =
'ts-delta'
Class Method Summary collapse
-
.cancel_jobs ⇒ Object
LTRIM + LPOP deletes all items from the Resque queue without loading it into client memory (unlike Resque.dequeue).
- .job_types ⇒ Object
Methods included from SphinxQL
Methods included from Binary
Class Method Details
.cancel_jobs ⇒ Object
LTRIM + LPOP deletes all items from the Resque queue without loading it into client memory (unlike Resque.dequeue). WARNING: This will clear ALL jobs in any queue used by a ResqueDelta job. If you’re sharing a queue with other jobs they’ll be deleted!
28 29 30 31 32 33 34 35 |
# File 'lib/thinking_sphinx/deltas/resque_delta.rb', line 28 def self.cancel_jobs job_types.collect { |klass| klass.instance_variable_get :@queue }.uniq.each do |queue| Resque.redis.ltrim "queue:#{queue}", 0, 0 Resque.redis.lpop "queue:#{queue}" end end |
.job_types ⇒ Object
17 18 19 20 21 22 |
# File 'lib/thinking_sphinx/deltas/resque_delta.rb', line 17 def self.job_types [ ThinkingSphinx::Deltas::ResqueDelta::DeltaJob, ThinkingSphinx::Deltas::ResqueDelta::FlagAsDeletedJob ] end |