Class: Concurrent::Runnable::Context
- Inherits:
-
Object
- Object
- Concurrent::Runnable::Context
- Defined in:
- lib/concurrent/runnable.rb
Instance Attribute Summary collapse
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
-
#initialize(runner) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(runner) ⇒ Context
Returns a new instance of Context.
11 12 13 14 15 16 17 18 |
# File 'lib/concurrent/runnable.rb', line 11 def initialize(runner) @runner = runner @thread = Thread.new(runner) do |runner| Thread.abort_on_exception = false runner.run end @thread.join(0.1) # let the thread start end |
Instance Attribute Details
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
10 11 12 |
# File 'lib/concurrent/runnable.rb', line 10 def runner @runner end |
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
10 11 12 |
# File 'lib/concurrent/runnable.rb', line 10 def thread @thread end |