Module: Adocca::MemCache::Server::TimeoutSocket
- Defined in:
- lib/am_memcache.rb
Defined Under Namespace
Classes: TimeoutError
Instance Method Summary collapse
Instance Method Details
#timeout_gets(timeout) ⇒ Object
421 422 423 424 425 426 427 |
# File 'lib/am_memcache.rb', line 421 def timeout_gets(timeout) if IO.select([self], nil, nil, timeout) self.gets else raise TimeoutError, "Timeout reached for #{self}.timeout_gets(#{timeout})" end end |
#timeout_write(message, timeout) ⇒ Object
414 415 416 417 418 419 420 |
# File 'lib/am_memcache.rb', line 414 def timeout_write(, timeout) if IO.select(nil, [self], nil, timeout) self.write() else raise TimeoutError, "Timeout reached for #{self}.timeout_write(#{.inspect}, #{timeout})" end end |