Class: RedisClient::Pipeline

Inherits:
Multi show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb

Instance Method Summary collapse

Methods inherited from Multi

#_blocks, #_commands, #_retryable?, #_size, #call, #call_once, #call_once_v, #call_v

Constructor Details

#initialize(_command_builder) ⇒ Pipeline

Returns a new instance of Pipeline.



531
532
533
534
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 531

def initialize(_command_builder)
  super
  @timeouts = nil
end

Instance Method Details

#_coerce!(results) ⇒ Object



562
563
564
565
566
567
568
569
570
571
572
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 562

def _coerce!(results)
  return results unless results

  @blocks&.each_with_index do |block, index|
    if block
      results[index] = block.call(results[index])
    end
  end

  results
end

#_empty?Boolean

Returns:

  • (Boolean)


558
559
560
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 558

def _empty?
  @commands.empty?
end

#_timeoutsObject



554
555
556
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 554

def _timeouts
  @timeouts
end

#blocking_call(timeout, *command, **kwargs, &block) ⇒ Object



536
537
538
539
540
541
542
543
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 536

def blocking_call(timeout, *command, **kwargs, &block)
  command = @command_builder.generate(command, kwargs)
  @timeouts ||= []
  @timeouts[@commands.size] = timeout
  (@blocks ||= [])[@commands.size] = block if block_given?
  @commands << command
  nil
end

#blocking_call_v(timeout, command, &block) ⇒ Object



545
546
547
548
549
550
551
552
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 545

def blocking_call_v(timeout, command, &block)
  command = @command_builder.generate(command)
  @timeouts ||= []
  @timeouts[@commands.size] = timeout
  (@blocks ||= [])[@commands.size] = block if block_given?
  @commands << command
  nil
end