def METHOD_NAME(self, topic, timeout=1):
    """Listen to a topic and return a message payload received within the
    specified time. Requires an Subscribe to have been called previously.
    `topic` topic to listen to
    `timeout` duration to listen, default to 1 second
    Examples:
    Listen and get a message received within 5 seconds
    | ${messages}= | Listen | test/test | timeout=5 |
    """
    timeout = 1 if timeout < 1 else timeout
    start = time.time()
    while True:
        if topic in self._messages and self._messages[topic]:
            msg = self._messages[topic].popleft()
            return msg
        if (
            self._wait(self._recved, timeout=timeout)
            or (time.time() - start) >= timeout
        ):
            break