Class: Healthyr::EventPool
- Inherits:
-
Object
- Object
- Healthyr::EventPool
- Defined in:
- lib/healthyr/event_pool.rb
Constant Summary collapse
- @@elements =
[]
- @@mutex =
Mutex.new
Class Method Summary collapse
Class Method Details
.add(element) ⇒ Object
6 7 8 9 10 |
# File 'lib/healthyr/event_pool.rb', line 6 def self.add(element) @@mutex.synchronize do @@elements << element end end |
.elements ⇒ Object
22 23 24 |
# File 'lib/healthyr/event_pool.rb', line 22 def self.elements @@elements end |
.flush ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/healthyr/event_pool.rb', line 12 def self.flush _elements = [] @@mutex.synchronize do _elements = @@elements.dup @@elements = [] end _elements end |