Class: Madeleine::Clock::TimeActor

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#destroyObject

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