MCPcopy Create free account
hub / github.com/openai/openai-python / drain

Method drain

src/openai/_send_queue.py:76–82  ·  view source on GitHub ↗

Remove and return all queued messages.

(self)

Source from the content-addressed store, hash-verified

74 raise
75
76 def drain(self) -> list[str]:
77 """Remove and return all queued messages."""
78 with self._lock:
79 items = [data for data, _ in self._queue]
80 self._queue.clear()
81 self._bytes = 0
82 return items
83
84 def __len__(self) -> int:
85 with self._lock:

Callers 9

__aiter__Method · 0.80
__iter__Method · 0.80
__aiter__Method · 0.80
__iter__Method · 0.80

Calls 1

clearMethod · 0.45