(self, namespace, callback)
return id
Generate a unique identifier for an ACK packet.
Generate a unique identifier for an ACK packet.
Generate a unique identifier for an ACK packet .
def _generate_ack_id(self, namespace, callback):
        """Generate a unique identifier for an ACK packet."""
        namespace = namespace or '/'
        if namespace not in self.callbacks:
            self.callbacks[namespace] = {0: itertools.count(1)}
        id = next(self.callbacks[namespace][0])
        self.callbacks[namespace][id] = callback
        return id
def _generate_ack_id ( self , namespace , callback ) : namespace = namespace or '/' if namespace not in self . callbacks : self . callbacks [ namespace ] = { 0 : itertools . count ( 1 ) } id = next ( self . callbacks [ namespace ] [ 0 ] ) self . callbacks [ namespace ] [ id ] = callback return id