Module: Travis::Lock

Extended by:
Lock
Included in:
Lock
Defined in:
lib/travis/lock.rb,
lib/travis/lock/none.rb,
lib/travis/lock/redis.rb,
lib/travis/lock/version.rb,
lib/travis/lock/postgresql.rb,
lib/travis/lock/support/retry.rb

Defined Under Namespace

Classes: None, Postgresql, Redis, Retry, Timeout

Constant Summary collapse

VERSION =
'0.1.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#default_strategyObject (readonly)

Returns the value of attribute default_strategy.



15
16
17
# File 'lib/travis/lock.rb', line 15

def default_strategy
  @default_strategy
end

Instance Method Details

#exclusive(name, options = {}, &block) ⇒ Object



17
18
19
20
# File 'lib/travis/lock.rb', line 17

def exclusive(name, options = {}, &block)
  options[:strategy] ||= Lock.default_strategy || :none
  const_get(camelize(options[:strategy])).new(name, options).exclusive(&block)
end