Esempio n. 1
0
 def publish_payload(self, package):
     log.trace('TCP PubServer starting to publish payload')
     package = package[0]  # ZMQ (The IPC calling us) ism :/
     payload = frame_msg(salt.payload.unpackage(package)['payload'], raw_body=True)
     to_remove = []
     for item in self.clients:
         client, address = item
         try:
             f = client.write(payload)
             self.io_loop.add_future(f, lambda f: True)
         except tornado.iostream.StreamClosedError:
             to_remove.append(item)
     for item in to_remove:
         client, address = item
         log.debug('Subscriber at {0} has disconnected from publisher'.format(address))
         client.close()
         self.clients.remove(item)
     log.trace('TCP PubServer finished publishing payload')
Esempio n. 2
0
File: tcp.py Progetto: DaveQB/salt
 def publish_payload(self, payload, _):
     payload = salt.transport.frame.frame_msg(payload['payload'], raw_body=True)
     log.debug('TCP PubServer sending payload: {0}'.format(payload))
     to_remove = []
     for item in self.clients:
         client, address = item
         try:
             # Write the packed str
             f = client.write(payload)
             self.io_loop.add_future(f, lambda f: True)
         except tornado.iostream.StreamClosedError:
             to_remove.append(item)
     for item in to_remove:
         client, address = item
         log.debug('Subscriber at {0} has disconnected from publisher'.format(address))
         client.close()
         self.clients.remove(item)
     log.trace('TCP PubServer finished publishing payload')
Esempio n. 3
0
    def publish_payload(self, payload, _):
        log.debug('TCP PubServer sending payload: {0}'.format(payload))
        payload = salt.transport.frame.frame_msg(payload['payload'])

        to_remove = []
        for item in self.clients:
            client, address = item
            try:
                # Write the packed str
                f = client.write(payload)
                self.io_loop.add_future(f, lambda f: True)
            except tornado.iostream.StreamClosedError:
                to_remove.append(item)
        for item in to_remove:
            client, address = item
            log.debug('Subscriber at {0} has disconnected from publisher'.format(address))
            client.close()
            self.clients.remove(item)
        log.trace('TCP PubServer finished publishing payload')