Class: RedisClient::Cluster::Pipeline::Extended

Inherits:
Pipeline
  • Object
show all
Defined in:
lib/redis_client/cluster/pipeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExtended

Returns a new instance of Extended.



16
17
18
19
# File 'lib/redis_client/cluster/pipeline.rb', line 16

def initialize(...)
  super
  @outer_indices = nil
end

Instance Attribute Details

#outer_indicesObject (readonly)

Returns the value of attribute outer_indices.



14
15
16
# File 'lib/redis_client/cluster/pipeline.rb', line 14

def outer_indices
  @outer_indices
end

Instance Method Details

#add_outer_index(index) ⇒ Object



21
22
23
24
# File 'lib/redis_client/cluster/pipeline.rb', line 21

def add_outer_index(index)
  @outer_indices ||= []
  @outer_indices << index
end

#get_block(inner_index) ⇒ Object



48
49
50
# File 'lib/redis_client/cluster/pipeline.rb', line 48

def get_block(inner_index)
  @blocks.is_a?(Array) ? @blocks[inner_index] : nil
end

#get_callee_method(inner_index) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/redis_client/cluster/pipeline.rb', line 30

def get_callee_method(inner_index)
  if @timeouts.is_a?(Array) && !@timeouts[inner_index].nil?
    :blocking_call_v
  elsif _retryable?
    :call_once_v
  else
    :call_v
  end
end

#get_command(inner_index) ⇒ Object



40
41
42
# File 'lib/redis_client/cluster/pipeline.rb', line 40

def get_command(inner_index)
  @commands.is_a?(Array) ? @commands[inner_index] : nil
end

#get_inner_index(outer_index) ⇒ Object



26
27
28
# File 'lib/redis_client/cluster/pipeline.rb', line 26

def get_inner_index(outer_index)
  @outer_indices&.find_index(outer_index)
end

#get_timeout(inner_index) ⇒ Object



44
45
46
# File 'lib/redis_client/cluster/pipeline.rb', line 44

def get_timeout(inner_index)
  @timeouts.is_a?(Array) ? @timeouts[inner_index] : nil
end