Class: Sunspot::ResqueSessionProxy

Inherits:
SessionProxy::AbstractSessionProxy
  • Object
show all
Defined in:
lib/sunspot/resque_session_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session, batch_size = 1000) ⇒ ResqueSessionProxy

Returns a new instance of ResqueSessionProxy.



13
14
15
16
# File 'lib/sunspot/resque_session_proxy.rb', line 13

def initialize(session, batch_size = 1000)
  @original_session = session
  @batch_size = batch_size
end

Instance Attribute Details

#batch_sizeObject (readonly)

Returns the value of attribute batch_size.



6
7
8
# File 'lib/sunspot/resque_session_proxy.rb', line 6

def batch_size
  @batch_size
end

#original_sessionObject (readonly) Also known as: session

Returns the value of attribute original_session.



6
7
8
# File 'lib/sunspot/resque_session_proxy.rb', line 6

def original_session
  @original_session
end

Instance Method Details

#commit(_soft_commit = false) ⇒ Object



60
61
62
# File 'lib/sunspot/resque_session_proxy.rb', line 60

def commit(_soft_commit = false)
  Resque.enqueue(SupplejackApi::IndexWorker, :commit)
end

#commit_if_delete_dirty(soft_commit = false) ⇒ Object



68
69
70
# File 'lib/sunspot/resque_session_proxy.rb', line 68

def commit_if_delete_dirty(soft_commit = false)
  # no-op
end

#commit_if_dirty(soft_commit = false) ⇒ Object



64
65
66
# File 'lib/sunspot/resque_session_proxy.rb', line 64

def commit_if_dirty(soft_commit = false)
  # no-op
end

#remove_all(clazz = nil) ⇒ Object



52
53
54
# File 'lib/sunspot/resque_session_proxy.rb', line 52

def remove_all(clazz = nil)
  Resque.enqueue SupplejackApi::IndexWorker, :remove_all, clazz.to_s
end

#remove_all!(clazz = nil) ⇒ Object



56
57
58
# File 'lib/sunspot/resque_session_proxy.rb', line 56

def remove_all!(clazz = nil)
  Resque.enqueue SupplejackApi::IndexWorker, :remove_all, clazz.to_s
end