class MNSSubscriber::Client

Public Class Methods

new(host: 'sps', port: 59000, dir: '.', options: {}, timeline: nil, log: nil, hashtag_url: nil) click to toggle source
Calls superclass method
# File lib/mns_subscriber.rb, line 355
def initialize(host: 'sps', port: 59000, dir: '.', options: {}, 
              timeline: nil, log: nil, hashtag_url: nil)
  
  @log = log
  log.info 'mns_subscriber/initialize: active' if log
  @nm = NoticeMgr.new(self, dir: dir, options: options, timeline: timeline, 
                hashtag_url: hashtag_url, debug: true)
  
  super(host: host, port: port, log: log)
  
end

Public Instance Methods

subscribe(topic='notice/*') click to toggle source
Calls superclass method
# File lib/mns_subscriber.rb, line 367
def subscribe(topic='notice/*')
  super(topic)
end

Private Instance Methods

ontopic(topic, msg) click to toggle source
# File lib/mns_subscriber.rb, line 373
def ontopic(topic, msg)
  
  @log.info 'mns_subscriber/ontopic: topic: ' + topic.inspect if @topic

  a = topic.split('/')
  #puts "%s: %s %s"  % [topic, Time.now.to_s, msg.inspect]
  
  @nm.incoming topic, msg  

end