Class: RSched::Lock

Inherits:
Object
  • Object
show all
Defined in:
lib/rsched/lock.rb

Direct Known Subclasses

DBLock

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname, timeout) ⇒ Lock

Returns a new instance of Lock.



6
7
8
9
# File 'lib/rsched/lock.rb', line 6

def initialize(hostname, timeout)
  @hostname = hostname
  @timeout = timeout
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname.



11
12
13
# File 'lib/rsched/lock.rb', line 11

def hostname
  @hostname
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



11
12
13
# File 'lib/rsched/lock.rb', line 11

def timeout
  @timeout
end

Instance Method Details

#acquire(ident, time, now = Time.now.to_i) ⇒ Object

acquired=token, locked=false, finished=nil



14
15
# File 'lib/rsched/lock.rb', line 14

def acquire(ident, time, now=Time.now.to_i)
end

#delete_before(ident, time) ⇒ Object



26
27
# File 'lib/rsched/lock.rb', line 26

def delete_before(ident, time)
end

#extend_timeout(token, timeout = Time.now.to_i+@timeout) ⇒ Object



23
24
# File 'lib/rsched/lock.rb', line 23

def extend_timeout(token, timeout=Time.now.to_i+@timeout)
end

#finish(token, now = Time.now.to_i) ⇒ Object



20
21
# File 'lib/rsched/lock.rb', line 20

def finish(token, now=Time.now.to_i)
end

#release(token) ⇒ Object



17
18
# File 'lib/rsched/lock.rb', line 17

def release(token)
end