Module: MultiRedis

Defined in:
lib/multi_redis.rb,
lib/multi_redis/data.rb,
lib/multi_redis/step.rb,
lib/multi_redis/future.rb,
lib/multi_redis/context.rb,
lib/multi_redis/executor.rb,
lib/multi_redis/extension.rb,
lib/multi_redis/operation.rb

Defined Under Namespace

Modules: Extension Classes: Context, Data, Executor, Future, FutureNotReady, Operation, Step

Constant Summary collapse

VERSION =
'0.3.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.redisObject

Returns the value of attribute redis


7
8
9
# File 'lib/multi_redis.rb', line 7

def redis
  @redis
end

Class Method Details

.execute(*args, &block) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/multi_redis.rb', line 10

def self.execute *args, &block

  options = args.last.kind_of?(Hash) ? args.pop : {}

  executor = nil
  @mutex.synchronize do
    @executor = Executor.new options
    args.each{ |op| @executor.add op }
    yield if block_given?
    executor = @executor
    @executor = nil
  end

  executor.execute
end