Class: GitMulticast::Task::Runner::PoorMansFuture
- Inherits:
-
Object
- Object
- GitMulticast::Task::Runner::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 ⇒ PoorMansFuture
constructor
A new instance of PoorMansFuture.
Constructor Details
#initialize ⇒ PoorMansFuture
Returns a new instance of PoorMansFuture.
23 24 25 26 27 |
# File 'lib/git_multicast/task/runner.rb', line 23 def initialize @thread = Thread.new do Thread.current[:output] = yield end end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
34 35 36 |
# File 'lib/git_multicast/task/runner.rb', line 34 def thread @thread end |
Instance Method Details
#get ⇒ Object
29 30 31 32 |
# File 'lib/git_multicast/task/runner.rb', line 29 def get thread.join thread[:output] end |