def setup(self, cfg): BasePlugin.setup(self, cfg) self.factory = MpdFactory(plugin=self) self.factory.plugin = self self.client = TCPClient(self.cfg.get("host", "localhost"), self.cfg.get("port", 6600), self.factory)
def setup(self, cfg): BasePlugin.setup(self, cfg) self.pn = Pubnub(cfg.get("publish_key"), cfg.get("subscribe_key"), cfg.get("secret_key"), cfg.get("ssl_enabled", False)) self.pn.subscribe({ "channel": cfg.get("channel", "default"), "connect": self.on_connect, "callback": self.on_message }) self.subscribe(self.on_event)
def setup(self, cfg): BasePlugin.setup(self, cfg) self.factory = MZMQFactory(plugin=self) self.factory.plugin = self self.pub_endpoint_uri = cfg.get("pub_endpoint", "tcp://*:9901") self.pub_endpoint = ZmqEndpoint("bind", self.pub_endpoint_uri) self.sub_endpoint_uri = cfg.get("sub_endpoint", "tcp://*:9901") self.sub_endpoint = ZmqEndpoint("connect", self.sub_endpoint_uri) self.pub = ZmqPubConnection(self.factory, self.pub_endpoint) self.sub = ZmqSubConnection(self.factory, self.sub_endpoint) self.sub.subscribe("") self.sub.gotMessage = self.on_message self.subscribe(self.process_event)
def setup(self, cfg): BasePlugin.setup(self, cfg) self.pn = Pubnub( cfg.get("publish_key"), cfg.get("subscribe_key"), cfg.get("secret_key"), cfg.get("ssl_enabled", False) ) self.pn.subscribe({ "channel": cfg.get("channel", "default"), "connect": self.on_connect, "callback": self.on_message }) self.subscribe(self.on_event)