Class: RestCore::ThreadPool::Task
- Inherits:
-
Struct
- Object
- Struct
- RestCore::ThreadPool::Task
- Defined in:
- lib/rest-core/thread_pool.rb
Instance Attribute Summary collapse
-
#job ⇒ Object
Returns the value of attribute job.
Instance Method Summary collapse
-
#call ⇒ Object
this should never fail.
-
#cancel ⇒ Object
called from the other thread telling us it’s timed out.
Instance Attribute Details
#job ⇒ Object
Returns the value of attribute job
44 45 46 |
# File 'lib/rest-core/thread_pool.rb', line 44 def job @job end |
Instance Method Details
#call ⇒ Object
this should never fail
46 47 48 49 |
# File 'lib/rest-core/thread_pool.rb', line 46 def call job.call unless cancelled true end |
#cancel ⇒ Object
called from the other thread telling us it’s timed out
52 53 54 |
# File 'lib/rest-core/thread_pool.rb', line 52 def cancel @cancelled = true end |