async def METHOD_NAME(self):
    count = 0
    while True:
        event = self._connection.next_event()
        if event is None:
            return
        if isinstance(event, aioquic.quic.events.StreamDataReceived):
            stream = self._streams.get(event.stream_id)
            if stream:
                await stream._add_input(event.data, event.end_stream)
        elif isinstance(event, aioquic.quic.events.HandshakeCompleted):
            self._handshake_complete.set()
        elif isinstance(
            event, aioquic.quic.events.ConnectionTerminated
        ) or isinstance(event, aioquic.quic.events.StreamReset):
            self._done = True
            self._socket.close()
        count += 1
        if count > 10:
            # yield
            count = 0
            await trio.sleep(0)