Module: Asgard::Base::Dispatch::ClassMethods
- Defined in:
- lib/asgard/base/dispatch.rb
Instance Method Summary collapse
- #_cond ⇒ Object
- #_done ⇒ Object
- #_ran_mutex ⇒ Object
-
#_reset_ran! ⇒ Object
Reset execution tracking for a fresh asgard invocation.
-
#_results ⇒ Object
Completed tasks' return values, keyed by task name — lets a task already run by one thread hand its result to another thread that shares the dependency, without either touching
self. - #_running ⇒ Object
Instance Method Details
#_cond ⇒ Object
27 28 29 |
# File 'lib/asgard/base/dispatch.rb', line 27 def _cond @_cond ||= Hash.new { |h, k| h[k] = ConditionVariable.new } end |
#_done ⇒ Object
23 24 25 |
# File 'lib/asgard/base/dispatch.rb', line 23 def _done @_done ||= Set.new end |
#_ran_mutex ⇒ Object
38 39 40 |
# File 'lib/asgard/base/dispatch.rb', line 38 def _ran_mutex @_ran_mutex ||= Mutex.new end |
#_reset_ran! ⇒ Object
Reset execution tracking for a fresh asgard invocation.
43 44 45 46 47 48 49 50 |
# File 'lib/asgard/base/dispatch.rb', line 43 def _reset_ran! _ran_mutex.synchronize do @_running = Set.new @_done = Set.new @_cond = Hash.new { |h, k| h[k] = ConditionVariable.new } @_results = {} end end |
#_results ⇒ Object
Completed tasks' return values, keyed by task name — lets a task
already run by one thread hand its result to another thread that
shares the dependency, without either touching self.
34 35 36 |
# File 'lib/asgard/base/dispatch.rb', line 34 def _results @_results ||= {} end |
#_running ⇒ Object
19 20 21 |
# File 'lib/asgard/base/dispatch.rb', line 19 def _running @_running ||= Set.new end |