Class: PositionUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/MINT-core/manager/position_updater.rb

Instance Method Summary collapse

Constructor Details

#initializePositionUpdater

Returns a new instance of PositionUpdater.



12
13
# File 'lib/MINT-core/manager/position_updater.rb', line 12

def initialize
end

Instance Method Details

#startObject



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, message|
    found=MultiJson.decode message
    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