THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class HTTPRequestPrinter(IHTTPRequestPrinter): (source)
Constructor: HTTPRequestPrinter()
Undocumented
| Method | __init__ |
Initialize the HTTPRequestPrinter instance. |
| Async Method | __worker |
Write queued lines to stdout in the background. |
| Method | print |
Print a formatted HTTP request line to stdout or queue. |
| Method | set |
Set whether to enable or disable console output for HTTP requests. |
| Async Method | start |
Start the background print worker. |
| Method | start |
Capture the current high-resolution timestamp for request timing. |
| Async Method | stop |
Drain remaining output and stop the background worker. |
| Constant | HTTP |
Undocumented |
| Constant | HTTP |
Undocumented |
| Constant | STATUS |
Undocumented |
| Instance Variable | __enabled |
Undocumented |
| Instance Variable | __queue |
Undocumented |
| Instance Variable | __start |
Undocumented |
| Instance Variable | __status |
Undocumented |
| Instance Variable | __worker |
Undocumented |
| Instance Variable | _flush |
Undocumented |
| Instance Variable | _total |
Undocumented |
| Instance Variable | _write |
Undocumented |
Initialize the HTTPRequestPrinter instance.
Determines terminal width, precomputes reusable ANSI-coloured strings, and prepares the async queue and worker task references.
| Returns | |
None | This method does not return a value. |
Write queued lines to stdout in the background.
Continuously reads lines from the internal async queue and writes them to stdout, flushing after each write to ensure immediate display.
| Returns | |
None | This method does not return a value. |
Print a formatted HTTP request line to stdout or queue.
Computes the elapsed duration from start_time, builds an ANSI-coloured output line, and either enqueues it for the background worker (if start() was called) or writes directly to stdout.
| Parameters | |
adapter:TransportAdapter | The transport adapter providing method and path information. |
response:Response | The HTTP response object. |
| Returns | |
None | This method does not return a value. |
Start the background print worker.
Creates the internal async queue and spawns a background task to drain queued output lines. Must be called once from an async context before the first request is handled.
| Returns | |
None | This method does not return a value. |
Capture the current high-resolution timestamp for request timing.
Returns None immediately if printing is disabled, avoiding unnecessary work when output has been suppressed via setEnabled(enabled=False).
| Returns | |
float | None | A high-resolution monotonic timestamp from time.perf_counter(), or None if output is disabled. |
Drain remaining output and stop the background worker.
Waits for every queued line to be written before cancelling the worker task. Safe to call even if start() was never invoked.
| Returns | |
None | This method does not return a value. |
Undocumented
| Value |
|