Class: Madeleine::Clock::TimeActor
- Inherits:
-
Object
- Object
- Madeleine::Clock::TimeActor
- Defined in:
- lib/madeleine/clock.rb
Overview
Sends clock ticks to update a ClockedSystem, so that time can be dealt with in a deterministic way.
Class Method Summary collapse
-
.launch(madeleine, delay = 0.1) ⇒ Object
Create and launch a new TimeActor.
Instance Method Summary collapse
-
#destroy ⇒ Object
Stops the TimeActor.
Class Method Details
.launch(madeleine, delay = 0.1) ⇒ Object
Create and launch a new TimeActor
-
madeleine
- The SnapshotMadeleine instance to work on. -
delay
- Delay between ticks in seconds (Optional).
32 33 34 35 |
# File 'lib/madeleine/clock.rb', line 32 def self.launch(madeleine, delay=0.1) result = new(madeleine, delay) result end |
Instance Method Details
#destroy ⇒ Object
Stops the TimeActor.
38 39 40 41 42 |
# File 'lib/madeleine/clock.rb', line 38 def destroy @is_destroyed = true @thread.wakeup @thread.join end |