Parent

Methods

Files

HTTPClient::TimeoutScheduler::Period

Represents timeout period.

Attributes

thread[R]
time[R]

Public Class Methods

new(thread, time, ex) click to toggle source

Creates new Period.

    # File lib/httpclient/timeout.rb, line 33
33:       def initialize(thread, time, ex)
34:         @thread, @time, @ex = thread, time, ex
35:         @lock = Mutex.new
36:       end

Public Instance Methods

cancel() click to toggle source

Cancel this Period. Mutex is needed to avoid too-late exception.

    # File lib/httpclient/timeout.rb, line 48
48:       def cancel
49:         @lock.synchronize do
50:           @thread = nil
51:         end
52:       end
raise(message) click to toggle source

Raises if thread exists and alive.

    # File lib/httpclient/timeout.rb, line 39
39:       def raise(message)
40:         @lock.synchronize do
41:           if @thread and @thread.alive?
42:             @thread.raise(@ex, message)
43:           end
44:         end
45:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.