import asyncio


class RTCRtpReceiver:
    async def _run(self, transport):
        # for now, just drain incoming data
        while True:
            try:
                await transport.recv()
            except ConnectionError:
                break


class RTCRtpSender:
    def __init__(self, track=None):
        self._track = track

    @property
    def track(self):
        return self._track

    async def _run(self, transport):
        pass


class RTCRtpTransceiver:
    """
    The RTCRtpTransceiver interface describes a permanent pairing of an
    :class:`RTCRtpSender` and an :class:`RTCRtpReceiver`, along with some
    shared state.
    """

    def __init__(self, receiver, sender):
        self.__receiver = receiver
        self.__sender = sender

    @property
    def direction(self):
        if self.sender.track:
            return 'sendrecv'
        else:
            return 'recvonly'

    @property
    def receiver(self):
        """
        The :class:`RTCRtpReceiver` that handles receiving and decoding
        incoming media.
        """
        return self.__receiver

    @property
    def sender(self):
        """
        The :class:`RTCRtpSender` responsible for encoding and sending
        data to the remote peer.
        """
        return self.__sender

    async def stop(self):
        """
        Permanently stops the :class:`RTCRtpTransceiver`.
        """
        pass

    async def _run(self, transport):
        await asyncio.wait([
            self.receiver._run(transport),
            self.sender._run(transport)])

@@ -9,16 +9,52 @@
 syncio%0A%0A
+from .utils import first_completed%0A%0A
 %0Aclass R
@@ -478,20 +478,92 @@
         
-pass
+# for now, do nothing%0A        while True:%0A            await asyncio.sleep(1)
 %0A%0A%0Aclass
@@ -866,24 +866,65 @@
 der = sender
+%0A        self.__stopped = asyncio.Event()
 %0A%0A    @prope
@@ -1561,12 +1561,28 @@
     
-pass
+self.__stopped.set()
 %0A%0A  
@@ -1634,22 +1634,24 @@
 ait 
-asyncio.wait(%5B
+first_completed(
 %0A   
@@ -1733,7 +1733,41 @@
 ort)
-%5D
+,%0A            self.__stopped.wait()
 )%0A

add loop that just sleeps