Class: PositionUpdater
- Inherits:
-
Object
- Object
- PositionUpdater
- Defined in:
- lib/MINT-core/manager/position_updater.rb
Instance Method Summary collapse
-
#initialize ⇒ PositionUpdater
constructor
A new instance of PositionUpdater.
- #start ⇒ Object
Constructor Details
#initialize ⇒ PositionUpdater
Returns a new instance of PositionUpdater.
12 13 |
# File 'lib/MINT-core/manager/position_updater.rb', line 12 def initialize end |
Instance Method Details
#start ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/MINT-core/manager/position_updater.rb', line 15 def start() redis = EventMachine::Hiredis.connect redis.pubsub.psubscribe("in_channel:Interactor.CIO.coordinates.*") { |key, | found=MultiJson.decode cio = CIO.get "cui-gfx",found['name'] #cio.x =found['x'] #cio.y = found['y'] cio.width=found['width'] cio.height = found['height'] cio.save CUIControl.update_cache(cio) puts found.inspect }.callback { p "subscribed to receive position updates"} end |