(self, item: T)
Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
Put an item into the queue.
Put an item into the queue .
async def put(self, item: T):
        """Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
        """

        with self._mutex:
            try:
                return self.put_nowait(item)
            except asyncio.QueueFull:
                # Queue is full, so start waiting until it has some
                # free space in the following while loop
                pass

            putter = asyncio.get_event_loop().create_future()
            self._putters.append(putter)

        while True:
            try:
                await putter
            except:
                with self._mutex:
                    putter.cancel()  # Just in case putter is not done yet.
                    try:
                        # Clean self._putters from canceled putters.
                        self._putters.remove(putter)
                    except ValueError:
                        # The putter could be removed from self._putters by a
                        # previous get_nowait call.
                        pass
                    if not self.full() and not putter.cancelled():
                        # We were woken up by get_nowait(), but can't take
                        # the call.  Wake up the next in line.
                        self._wakeup_next(self._putters)
                raise

            with self._mutex:
                try:
                    return self.put_nowait(item)
                except asyncio.QueueFull:
                    putter = asyncio.get_event_loop().create_future()
                    self._putters.append(putter)
async def put ( self , item : T ) : with self . _mutex : try : return self . put_nowait ( item ) except asyncio . QueueFull : # Queue is full, so start waiting until it has some # free space in the following while loop pass putter = asyncio . get_event_loop ( ) . create_future ( ) self . _putters . append ( putter ) while True : try : await putter except : with self . _mutex : putter . cancel ( ) # Just in case putter is not done yet. try : # Clean self._putters from canceled putters. self . _putters . remove ( putter ) except ValueError : # The putter could be removed from self._putters by a # previous get_nowait call. pass if not self . full ( ) and not putter . cancelled ( ) : # We were woken up by get_nowait(), but can't take # the call.  Wake up the next in line. self . _wakeup_next ( self . _putters ) raise with self . _mutex : try : return self . put_nowait ( item ) except asyncio . QueueFull : putter = asyncio . get_event_loop ( ) . create_future ( ) self . _putters . append ( putter )