Class: GitMulticast::TaskRunner::PoorMansFuture
- Inherits:
-
Object
- Object
- GitMulticast::TaskRunner::PoorMansFuture
- Defined in:
- lib/git_multicast/task_runner.rb
Instance Attribute Summary collapse
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(&block) ⇒ PoorMansFuture
constructor
A new instance of PoorMansFuture.
Constructor Details
#initialize(&block) ⇒ PoorMansFuture
Returns a new instance of PoorMansFuture.
26 27 28 29 30 |
# File 'lib/git_multicast/task_runner.rb', line 26 def initialize(&block) @thread = Thread.new do Thread.current[:output] = block.call end end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
37 38 39 |
# File 'lib/git_multicast/task_runner.rb', line 37 def thread @thread end |
Instance Method Details
#get ⇒ Object
32 33 34 35 |
# File 'lib/git_multicast/task_runner.rb', line 32 def get thread.join thread[:output] end |