def mqtt_subscribe(self, topics, packet_id):
        """
        :param topics: array of topics [{'filter':'/a/b', 'qos': 0x00}, ...]
        :return:
        """

        # Build and send SUBSCRIBE message
        subscribe = SubscribePacket.build(topics, packet_id)
        yield from self._send_packet(subscribe)

        # Wait for SUBACK is received
        waiter = futures.Future(loop=self._loop)
        self._subscriptions_waiter[subscribe.variable_header.packet_id] = waiter
        return_codes = yield from waiter

        del self._subscriptions_waiter[subscribe.variable_header.packet_id]
        return return_codes
def mqtt_subscribe ( self , topics , packet_id ) : subscribe = SubscribePacket . build ( topics , packet_id ) yield from self . _send_packet ( subscribe ) waiter = futures . Future ( loop = self . _loop ) self . _subscriptions_waiter [ subscribe . variable_header . packet_id ] = waiter return_codes = yield from waiter del self . _subscriptions_waiter [ subscribe . variable_header . packet_id ] return return_codes
:param topics: array of topics [{'filter':'/a/b', 'qos': 0x00}, ...]
        :return: