Class: Chan::NullLock

Inherits:
Object
  • Object
show all
Defined in:
lib/xchan/null_lock.rb

Overview

Chan::NullLock is a no-op lock that can be used instead of the standard file lock when a lock is not needed

Examples:

ch = xchan(:marshal, lock: Chan::NullLock)
ch.send([1,2,3])
# ditto
ch = xchan(:marshal, lock: :null)
ch.send([1,2,3])

Class Method Summary collapse

Class Method Details

.lockvoid

This method returns an undefined value.

Returns This method is a no-op.



17
18
# File 'lib/xchan/null_lock.rb', line 17

def self.lock
end

.lock_nonblockvoid

This method returns an undefined value.

Returns This method is a no-op.



23
24
# File 'lib/xchan/null_lock.rb', line 23

def self.lock_nonblock
end

.releasevoid

This method returns an undefined value.

Returns This method is a no-op.



29
30
# File 'lib/xchan/null_lock.rb', line 29

def self.release
end

.closevoid

This method returns an undefined value.

Returns This method is a no-op.



35
36
# File 'lib/xchan/null_lock.rb', line 35

def self.close
end

.locked?void

This method returns an undefined value.

Returns This method always returns false.



41
42
43
# File 'lib/xchan/null_lock.rb', line 41

def self.locked?
  false
end