Class: RedisClient::Pipeline
- Inherits:
-
Multi
- Object
- Multi
- RedisClient::Pipeline
show all
- Defined in:
- 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.
689
690
691
692
|
# File 'lib/redis_client.rb', line 689
def initialize(_command_builder)
super
@timeouts = nil
end
|
Instance Method Details
#_coerce!(results) ⇒ Object
720
721
722
723
724
725
726
727
728
729
730
|
# File 'lib/redis_client.rb', line 720
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
716
717
718
|
# File 'lib/redis_client.rb', line 716
def _empty?
@commands.empty?
end
|
#_timeouts ⇒ Object
712
713
714
|
# File 'lib/redis_client.rb', line 712
def _timeouts
@timeouts
end
|
#blocking_call(timeout, *command, **kwargs, &block) ⇒ Object
694
695
696
697
698
699
700
701
|
# File 'lib/redis_client.rb', line 694
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
703
704
705
706
707
708
709
710
|
# File 'lib/redis_client.rb', line 703
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
|