(self)
Remove and return an item from the queue.

        If queue is empty, wait until an item is available.
Remove and return an item from the queue.
Remove and return an item from the queue .
async def get(self) -> T:
        """Remove and return an item from the queue.

        If queue is empty, wait until an item is available.
        """
        with self._mutex:
            try:
                return self.get_nowait()
            except asyncio.QueueEmpty:
                pass

            getter = asyncio.get_event_loop().create_future()
            self._getters.append(getter)

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

            with self._mutex:
                try:
                    return self.get_nowait()
                except asyncio.QueueEmpty:
                    getter = asyncio.get_event_loop().create_future()
                    self._getters.append(getter)
async def get ( self ) -> T : with self . _mutex : try : return self . get_nowait ( ) except asyncio . QueueEmpty : pass getter = asyncio . get_event_loop ( ) . create_future ( ) self . _getters . append ( getter ) while True : try : await getter except : with self . _mutex : getter . cancel ( ) # Just in case getter is not done yet. try : # Clean self._getters from canceled getters. self . _getters . remove ( getter ) except ValueError : # The getter could be removed from self._getters by a # previous put_nowait call. pass if not self . empty ( ) and not getter . cancelled ( ) : # We were woken up by put_nowait(), but can't take # the call.  Wake up the next in line. self . _wakeup_next ( self . _getters ) raise with self . _mutex : try : return self . get_nowait ( ) except asyncio . QueueEmpty : getter = asyncio . get_event_loop ( ) . create_future ( ) self . _getters . append ( getter )