Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 15, 2025

Summary

Fixes the documentation in "Memory and Buffers" topic page which incorrectly stated that max_queue doesn't exist in the threading implementation.

Issue

The documentation stated:

In the :mod:threading implementation, there is no queue of incoming messages. The max_queue argument doesn't exist. The connection keeps at most one message in memory at a time.

However, the threading (sync) implementation does have the max_queue argument and it works the same way as in the new asyncio implementation.

Changes

Updated docs/topics/memory.rst to correctly document that:

  • The max_queue argument exists in the threading implementation
  • It has the same semantics as the new asyncio implementation
  • It is the high-water mark of a queue of incoming frames
  • It defaults to 16 frames (same as asyncio)
  • It provides backpressure control when the queue grows above the high-water mark

Context

As noted by @aaugustin in the issue, max_queue wasn't in the initial version of the threading implementation but was added later as a performance optimization. The documentation was never updated to reflect this change.

Closes #1544

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • django-sesame.readthedocs.io
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/sphinx-build -M html . _build (dns block)
  • docs.python.org
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/sphinx-build -M html . _build (dns block)
  • werkzeug.palletsprojects.com
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/sphinx-build -M html . _build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>"Memory and Buffers" docs and max_queue in threading implementation</issue_title>
<issue_description>I believe the topic page "Memory and Buffers" in the documentation might need to be updated - in the end it says:

In the threading implementation, there is no queue of incoming messages. The max_queue argument doesn’t exist. The connection keeps at most one message in memory at a time.

But looks like max_queue exists in the threading implementation - I guess works the same as in the asyncio one?</issue_description>

Comments on the Issue (you are @copilot in this section)

@aaugustin Good catch, thank you. I think it wasn't there in the initial version, then got added later as a performance optimization. Yes it has the same semantics as in the asyncio implementation.

Fixes #1664


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Update memory and buffers documentation for max_queue Update documentation: max_queue exists in threading implementation Oct 15, 2025
@Copilot Copilot AI requested a review from aaugustin October 15, 2025 19:40
Copilot finished work on behalf of aaugustin October 15, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Memory and Buffers" docs and max_queue in threading implementation Sesame Package is archived

2 participants