Class: TTK::Testers::Tester::RunningTask
- Defined in:
- lib/ttk/testers/tester/running_task.rb
Instance Method Summary collapse
- #[]=(key, val) ⇒ Object
- #abort(key) ⇒ Object
- #delete(key) ⇒ Object
-
#initialize ⇒ RunningTask
constructor
A new instance of RunningTask.
- #size ⇒ Object (also: #length)
Constructor Details
#initialize ⇒ RunningTask
Returns a new instance of RunningTask.
15 16 17 18 |
# File 'lib/ttk/testers/tester/running_task.rb', line 15 def initialize @mutex = Mutex.new @hash = {} end |
Instance Method Details
#[]=(key, val) ⇒ Object
20 21 22 |
# File 'lib/ttk/testers/tester/running_task.rb', line 20 def []=(key, val) @mutex.synchronize { @hash[key] = val } end |
#abort(key) ⇒ Object
34 35 36 37 38 |
# File 'lib/ttk/testers/tester/running_task.rb', line 34 def abort(key) @mutex.synchronize do @hash[key].abort if @hash.has_key?(key) end end |
#delete(key) ⇒ Object
24 25 26 |
# File 'lib/ttk/testers/tester/running_task.rb', line 24 def delete(key) @mutex.synchronize { @hash.delete(key) } end |
#size ⇒ Object Also known as: length
28 29 30 |
# File 'lib/ttk/testers/tester/running_task.rb', line 28 def size @mutex.synchronize { @hash.size } end |