Skip to content

QueueOutputWriter

Base classes

Name Children Inherits
DefaultOutputWriter
slashed.output
Default output implementation using rich if available.

⋔ Inheritance diagram

graph TD
  580203803["output.QueueOutputWriter"]
  3554766017["output.DefaultOutputWriter"]
  1594020653["base.OutputWriter"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  3554766017 --> 580203803
  1594020653 --> 3554766017
  1073422405 --> 1594020653
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: DefaultOutputWriter

Output writer that puts messages in queue.

Source code in src/slashed/output.py
class QueueOutputWriter(DefaultOutputWriter):
    """Output writer that puts messages in queue."""

    def __init__(self, queue: asyncio.Queue[str]) -> None:
        self.queue = queue

    async def print(self, message: str) -> None:
        await self.queue.put(message)

:fa-brands-github: Show source on GitHub