-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-40638: Add AsyncMultiQueue data structure #195
Conversation
Sphinx plus the extensions we use is refusing to generate any method documentation for |
Add an asyncio multiple writer, multiple reader queue, and convert the Kubernetes mock to use it instead of implementing its own. This data structure is also used in the JupyterHub REST spawner and in the Nublado lab controller.
3fde461
to
ecb6274
Compare
I'm not sure about the docs build. I tried simplifying the class; I tried upgrading to Sphinx 7... so far nothing seems to be working. |
Dropping |
It feels like an |
It seems that the |
I was wondering about that, but that was exactly my confusion. I added a bound of |
Ah, it is a bug but I found a workaround. I have to flag it with |
sphinx_automodsumm's ability to discover the methods of a class appears to have some bug with some but not all classes that inherit from Generic that seems to be related to the use of __slots__ to determine the methods of the class. Tagging safir.asyncio with :inherited-members: changes the code to use dir() to retrieve all members instead, which avoids the problem.
Replace the mention of the clear method with a proper cross-reference now that documentation generation is working correctly.
There's no need to set the trigger when adding a new iterator, since the first thing the iterator does is unconditionally clear the trigger and look at the contents of the queue.
In order to support the way another version of this data structure was used in the Nublado REST spawner, add a way to mark the queue contents as complete without clearing it. This supports the use case of starting a reader after the queue is complete and therefore should signal iterators to end, allowing it to see all of the captured data and then immediately exit without further waiting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very neat class.
On further thought, close is a more obvious name for this method than end, making it clear that no further data can be sent similar to a socket close. Add more documentation for how close and clear work.
Add an asyncio multiple writer, multiple reader queue, and convert the Kubernetes mock to use it instead of implementing its own. This data structure is also used in the JupyterHub REST spawner and in the Nublado lab controller.