'Internal handler for when a stream priority is updated.
@param event: The Hyper-h2 event that encodes information about the
stream reprioritization.
@type event: L{h2.events.PriorityUpdated}'

def _handlePriorityUpdate(self, event):

    try:
        self.priority.reprioritize(stream_id=event.stream_id, depends_on=(event.depends_on or None), weight=event.weight, exclusive=event.exclusive)
    except priority.MissingStreamError:
        self.priority.insert_stream(stream_id=event.stream_id, depends_on=(event.depends_on or None), weight=event.weight, exclusive=event.exclusive)
        self.priority.block(event.stream_id)
