Sha256: 7a4646746ce08dbe30c70808de8f08b33962135f2828ff107f3bd1a4433c3ca6
Contents?: true
Size: 851 Bytes
Versions: 2
Compression:
Stored size: 851 Bytes
Contents
module GameMachine class Scheduler < Actor::Base def preStart scheduler = get_context.system.scheduler dispatcher = get_context.system.dispatcher every_second = JavaLib::Duration.create(1, java.util.concurrent.TimeUnit::SECONDS) #scheduler.schedule(every_second, every_second, get_self, "every_second", dispatcher, nil) every_10_seconds = JavaLib::Duration.create(10, java.util.concurrent.TimeUnit::SECONDS) #scheduler.schedule(every_10_seconds, every_10_seconds, get_self, "every_10_seconds", dispatcher, nil) end def on_receive(message) if message == 'every_10_seconds' #GameMachine.logger.debug "Cluster members #{ClusterMonitor.cluster_members.keys.to_a.inspect}" #GameMachine.logger.debug "Hashrings #{Akka.instance.hashring.nodes.inspect}" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
game_machine-1.0.4 | lib/game_machine/scheduler.rb |
game_machine-1.0.2 | lib/game_machine/scheduler.rb |