Class: TIMEx::Strategies::Closeable
- Defined in:
- lib/timex/strategies/closeable.rb
Overview
Note:
close_method runs concurrently with the user block. It must be
safe to call while the block uses the resource; avoid mutual deadlocks on
the same mutex.
Invokes close_method on a watchdog thread after the deadline so blocking
I/O surfaces as IOError / EBADF / EPIPE (etc.), then maps those to
Expired when the close was timer-driven.
Instance Method Summary collapse
-
#initialize(resource:, close_method: :close) ⇒ Closeable
constructor
A new instance of Closeable.
Methods inherited from Base
Constructor Details
#initialize(resource:, close_method: :close) ⇒ Closeable
Returns a new instance of Closeable.
18 19 20 21 22 |
# File 'lib/timex/strategies/closeable.rb', line 18 def initialize(resource:, close_method: :close) super() @resource = resource @close_method = close_method end |