MCPcopy Index your code
hub / github.com/python-websockets/websockets / maybe_pause

Method maybe_pause

src/websockets/sync/messages.py:301–312  ·  view source on GitHub ↗

Pause the writer if queue is above the high water mark.

(self)

Source from the content-addressed store, hash-verified

299 # runs and skipping a pause() - resume() cycle that would otherwise occur.
300
301 def maybe_pause(self) -> None:
302 """Pause the writer if queue is above the high water mark."""
303 # Skip if flow control is disabled.
304 if self.high is None:
305 return
306
307 assert self.mutex.locked()
308
309 # Check for "> high" to support high = 0.
310 if self.frames.qsize() > self.high and not self.paused:
311 self.paused = True
312 self.pause()
313
314 def maybe_resume(self) -> None:
315 """Resume the writer if queue is below the low water mark."""

Callers 1

putMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected