Class: Alexandria::UI::SearchThreadMonitor
- Inherits:
-
Monitor
- Object
- Monitor
- Alexandria::UI::SearchThreadMonitor
- Defined in:
- lib/alexandria/ui/acquire_dialog.rb
Overview
assists in turning on progress bar when searching and turning it off when all search threads have completed…
Instance Method Summary collapse
- #any? ⇒ Boolean
- #end_search ⇒ Object
-
#initialize ⇒ SearchThreadMonitor
constructor
A new instance of SearchThreadMonitor.
- #new_search ⇒ Object
- #none? ⇒ Boolean
Constructor Details
#initialize ⇒ SearchThreadMonitor
Returns a new instance of SearchThreadMonitor.
24 25 26 27 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 24 def initialize @count = 0 super end |
Instance Method Details
#any? ⇒ Boolean
41 42 43 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 41 def any? @count > 0 end |
#end_search ⇒ Object
35 36 37 38 39 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 35 def end_search synchronize do @count -= 1 unless @count.zero? end end |
#new_search ⇒ Object
29 30 31 32 33 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 29 def new_search synchronize do @count += 1 end end |
#none? ⇒ Boolean
45 46 47 |
# File 'lib/alexandria/ui/acquire_dialog.rb', line 45 def none? @count.zero? end |