'Internal handler for when a request has been received.
@param event: The Hyper-h2 event that encodes information about the
received request.
@type event: L{h2.events.RequestReceived}'

def _requestReceived(self, event):

    stream = H2Stream(event.stream_id, self, event.headers, self.requestFactory, self.site, self.factory)
    self.streams[event.stream_id] = stream
    self._streamCleanupCallbacks[event.stream_id] = Deferred()
    self._outboundStreamQueues[event.stream_id] = deque()
    try:
        self.priority.insert_stream(event.stream_id)
    except priority.DuplicateStreamError:
        pass
    else:
        self.priority.block(event.stream_id)
