Class: Hayabusa::Thread_instance
- Inherits:
-
Object
- Object
- Hayabusa::Thread_instance
- Defined in:
- lib/hayabusa_ext/threadding.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #done? ⇒ Boolean
- #error? ⇒ Boolean
-
#initialize(args) ⇒ Thread_instance
constructor
A new instance of Thread_instance.
- #join ⇒ Object
- #join_error ⇒ Object
- #running? ⇒ Boolean
Constructor Details
#initialize(args) ⇒ Thread_instance
Returns a new instance of Thread_instance.
101 102 103 |
# File 'lib/hayabusa_ext/threadding.rb', line 101 def initialize(args) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
99 100 101 |
# File 'lib/hayabusa_ext/threadding.rb', line 99 def args @args end |
Instance Method Details
#done? ⇒ Boolean
109 110 111 |
# File 'lib/hayabusa_ext/threadding.rb', line 109 def done? return @args[:done] end |
#error? ⇒ Boolean
113 114 115 116 |
# File 'lib/hayabusa_ext/threadding.rb', line 113 def error? return true if @args[:error] return false end |
#join ⇒ Object
118 119 120 121 122 |
# File 'lib/hayabusa_ext/threadding.rb', line 118 def join while !@args[:done] and !@args[:error] sleep 0.1 end end |
#join_error ⇒ Object
124 125 126 127 |
# File 'lib/hayabusa_ext/threadding.rb', line 124 def join_error self.join raise @args[:error_obj] if @args[:error_obj] end |
#running? ⇒ Boolean
105 106 107 |
# File 'lib/hayabusa_ext/threadding.rb', line 105 def running? return @args[:running] end |