Class: TTK::Testers::Tester::RunningTask

Inherits:
Object
  • Object
show all
Defined in:
lib/ttk/testers/tester/running_task.rb

Instance Method Summary collapse

Constructor Details

#initializeRunningTask

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

#sizeObject Also known as: length



28
29
30
# File 'lib/ttk/testers/tester/running_task.rb', line 28

def size
  @mutex.synchronize { @hash.size }
end