Module: Elasticsearch::Model::TransactionalCallbacks::Manager

Defined in:
lib/elasticsearch/model/transactional_callbacks/manager.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.captureObject



11
12
13
14
15
16
17
18
19
# File 'lib/elasticsearch/model/transactional_callbacks/manager.rb', line 11

def capture
  counter_stack.push(:lol)

  yield.tap do
    register_job if counter_stack.length == 1
  end
ensure
  counter_stack.pop
end

.queueObject



21
22
23
# File 'lib/elasticsearch/model/transactional_callbacks/manager.rb', line 21

def queue
  Thread.current[:elasticsearch_transactional_queue] ||= Queue.new
end