def receiver_run(receiver, msg_items):
    """
    Receiver function that will be run in a thread.
    It invokes the receiver until out of notifications, then return them as a
    list.
    """
    for headers, message in receiver.notifications():
        msg_items.append((headers, message))
    return msg_items