mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 13:52:34 +00:00
Fixed some issues related to threading in game clock by using a queue
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
module TAC
|
||||
class PracticeGameClock
|
||||
class ClockProxy
|
||||
attr_reader :queue, :clock
|
||||
|
||||
def initialize(clock, jukebox)
|
||||
@clock = clock
|
||||
@jukebox = jukebox
|
||||
|
||||
@queue = []
|
||||
@callbacks = {}
|
||||
end
|
||||
|
||||
def enqueue(&block)
|
||||
@queue << block
|
||||
end
|
||||
|
||||
def register(callback, method)
|
||||
@callbacks[callback] = method
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user