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

#initialize(command_builder) ⇒ Extended

Returns a new instance of Extended.



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

def initialize(command_builder)
  super
  @outer_indices = nil
end

Instance Attribute Details

#outer_indicesObject (readonly)

Returns the value of attribute outer_indices.



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

def outer_indices
  @outer_indices
end

Instance Method Details

#add_outer_index(index) ⇒ Object



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

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

#get_block(inner_index) ⇒ Object



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

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

#get_callee_method(inner_index) ⇒ Object



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

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



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

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

#get_inner_index(outer_index) ⇒ Object



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

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

#get_timeout(inner_index) ⇒ Object



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

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