lib/marvin/irc/socket_client.rb in Sutto-marvin-0.1.0.20081016 vs lib/marvin/irc/socket_client.rb in Sutto-marvin-0.1.20081115
- old
+ new
@@ -54,10 +54,16 @@
logger.debug "Stopped."
end
# Registers a callback handle that will be periodically run.
def periodically(timing, event_callback)
- callback = proc { self.dispatch_event event_callback.to_sym }
+ callback = proc { self.dispatch event_callback.to_sym }
+ Thread.new do
+ while true
+ callback.call
+ sleep timing
+ end
+ end
end
end
end
\ No newline at end of file