Return True if the queue is full, False otherwise (not reliable!). This method is likely to be removed at some point. Use qsize() >= n as a direct substitute, but be aware that either approach risks a race condition where a queue can shrink before the result of full() or
(self)
| 124 | return not self._qsize() |
| 125 | |
| 126 | def full(self): |
| 127 | '''Return True if the queue is full, False otherwise (not reliable!). |
| 128 | |
| 129 | This method is likely to be removed at some point. Use qsize() >= n |
| 130 | as a direct substitute, but be aware that either approach risks a race |
| 131 | condition where a queue can shrink before the result of full() or |
| 132 | qsize() can be used. |
| 133 | ''' |
| 134 | with self.mutex: |
| 135 | return 0 < self.maxsize <= self._qsize() |
| 136 | |
| 137 | def put(self, item, block=True, timeout=None): |
| 138 | '''Put an item into the queue. |