Check if the buffer contains enough data to fulfill a request of a specified length. Parameters: - length (int): The number of elements required. Returns: - bool: True if the buffer contains enough data, False otherwise.
(self, length)
| 70 | self.buffer = np.array([], dtype=np.float32) |
| 71 | |
| 72 | def has_enough_data(self, length): |
| 73 | """ |
| 74 | Check if the buffer contains enough data to fulfill a request of a specified length. |
| 75 | |
| 76 | Parameters: |
| 77 | - length (int): The number of elements required. |
| 78 | |
| 79 | Returns: |
| 80 | - bool: True if the buffer contains enough data, False otherwise. |
| 81 | """ |
| 82 | with self.lock: |
| 83 | return len(self.buffer) >= length |
| 84 | |
| 85 | |
| 86 | class ThreadSafeQueue: |
nothing calls this directly
no outgoing calls
no test coverage detected