aistore.sdk.etl.webserver.http_multi_threaded_server
aistore.sdk.etl.webserver.http_multi_threaded_server
Module Contents
Classes
API
Bases: ETLServer
Multi-threaded HTTP server implementation for ETL payload transformation. Handles GET and PUT requests via a request handler class.
Starts the HTTP server and gracefully handles SIGTERM/SIGINT for Kubernetes.
Bases: ThreadingMixIn, HTTPServer
Multi-threaded HTTP server that delegates ETL logic to a provided ETLServer instance.
Bases: RawIOBase
Bound BaseHTTPRequestHandler.rfile to the current PUT body length.
self.rfile is the raw connection stream; it has no intrinsic EOF at the
end of this request body. Passing it directly to transform_stream would
cause any transform that calls reader.read() with no size argument to
block indefinitely waiting for the client to close the connection.
This wrapper tracks Content-Length remaining bytes and clamps every
read() call accordingly, giving transforms the same EOF semantics they
get from a BytesIO — without buffering the full body upfront.
The request body is one-shot; _direct_put_stream_with_retry sets
effective_retries=0 on this path. close() drains any unread bytes
from the request body so a transform that exits early does not leave
residual data on a keep-alive connection.