pyarrow.flight.ServerMiddleware β Apache Arrow v20.0.0 (original) (raw)
class pyarrow.flight.ServerMiddleware#
Bases: _Weakrefable
Server-side middleware for a call, instantiated per RPC.
Methods here should be fast and must be infallible: they should not raise exceptions or stall indefinitely.
__init__(*args, **kwargs)#
Methods
call_completed(self, exception)#
A callback when the call finishes.
Parameters:
exceptionpyarrow.ArrowException
If the call errored, this is the equivalent exception. Will be None if the call succeeded.
A callback before headers are sent.
Returns:
headersdict
A dictionary of header values to add to the response, or None if no headers are to be added. The dictionary should have string keys and string or list-of-string values.
Bytes values are allowed, but the underlying transport may not support them or may restrict them. For gRPC, binary values are only allowed on headers ending in β-binβ.
Header names must be lowercase ASCII.