pyarrow.flight.ServerMiddleware#

classpyarrow.flight.ServerMiddleware#

Bases:_Weakrefable

Server-side middleware for a call, instantiated per RPC.

Methods here should be fast and must be infallible: they shouldnot raise exceptions or stall indefinitely.

__init__(*args,**kwargs)#

Methods

__init__(*args, **kwargs)

call_completed(self, exception)

A callback when the call finishes.

sending_headers(self)

A callback before headers are sent.

call_completed(self,exception)#

A callback when the call finishes.

Parameters:
exceptionpyarrow.ArrowException

If the call errored, this is the equivalentexception. Will be None if the call succeeded.

sending_headers(self)#

A callback before headers are sent.

Returns:
headersdict

A dictionary of header values to add to the response, orNone if no headers are to be added. The dictionary shouldhave string keys and string or list-of-string values.

Bytes values are allowed, but the underlying transport maynot support them or may restrict them. For gRPC, binaryvalues are only allowed on headers ending in “-bin”.

Header names must be lowercase ASCII.