Class: Selenium::WebDriver::SocketLock Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::SocketLock
- Defined in:
- rb/lib/selenium/webdriver/common/socket_lock.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(port, timeout) ⇒ SocketLock
constructor
private
A new instance of SocketLock.
-
#locked ⇒ Object
private
Attempt to acquire a lock on the given port.
Constructor Details
#initialize(port, timeout) ⇒ SocketLock
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SocketLock.
27 28 29 30 31 |
# File 'rb/lib/selenium/webdriver/common/socket_lock.rb', line 27 def initialize(port, timeout) @port = port @server = nil @timeout = timeout end |
Instance Method Details
#locked ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Attempt to acquire a lock on the given port. Control is yielded to an execution block if the lock could be successfully obtained.
38 39 40 41 42 43 44 45 46 |
# File 'rb/lib/selenium/webdriver/common/socket_lock.rb', line 38 def locked lock begin yield ensure release end end |