Class: Ferrum::Utils::Event
- Inherits:
-
Concurrent::Event
- Object
- Concurrent::Event
- Ferrum::Utils::Event
- Defined in:
- lib/ferrum/utils/event.rb
Overview
A Concurrent::Event subclass that additionally tracks how many times it has been reset, via #iteration.
Instance Method Summary collapse
-
#iteration ⇒ Integer
Number of times the event has been reset.
-
#reset ⇒ Integer
Marks the event as unset and increments the iteration counter.
Instance Method Details
#iteration ⇒ Integer
Number of times the event has been reset.
15 16 17 |
# File 'lib/ferrum/utils/event.rb', line 15 def iteration synchronize { @iteration } end |
#reset ⇒ Integer
Marks the event as unset and increments the iteration counter.
24 25 26 27 28 29 30 |
# File 'lib/ferrum/utils/event.rb', line 24 def reset synchronize do @iteration += 1 @set = false if @set @iteration end end |