Class: OpenC3::StoreConnectionPool

Inherits:
ConnectionPool
  • Object
show all
Defined in:
lib/openc3/utilities/store_autoload.rb

Instance Method Summary collapse

Instance Method Details

#pipelinedObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/openc3/utilities/store_autoload.rb', line 25

def pipelined
  with do |redis|
    redis.pipelined do |pipeline|
      Thread.current[:pipeline] = pipeline
      begin
        yield
      ensure
        Thread.current[:pipeline] = nil
      end
    end
  end
end

#with(**options, &block) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/openc3/utilities/store_autoload.rb', line 38

def with(**options, &block)
  pipeline = Thread.current[:pipeline]
  if pipeline
    yield pipeline
  else
    super(**options, &block)
  end
end