'Notify for the room events that were queued waiting for a previous
event to be persisted.
Args:
max_room_stream_id(int): The highest stream_id below which all
events have been persisted.'

def _notify_pending_new_room_events(self, max_room_stream_id):

    pending = self.pending_new_room_events
    self.pending_new_room_events = []
    for (room_stream_id, event, extra_users) in pending:
        if (room_stream_id > max_room_stream_id):
            self.pending_new_room_events.append((room_stream_id, event, extra_users))
        else:
            self._on_new_room_event(event, room_stream_id, extra_users)
