pyarrow.flight.ServerMiddlewareFactory#

classpyarrow.flight.ServerMiddlewareFactory#

Bases:_Weakrefable

A factory for new middleware instances.

All middleware methods will be called from the same thread as theRPC method implementation. That is, thread-locals set in themiddleware are accessible from the method itself.

__init__(*args,**kwargs)#

Methods

__init__(*args, **kwargs)

start_call(self, info, headers)

Called at the start of an RPC.

start_call(self,info,headers)#

Called at the start of an RPC.

This must be thread-safe.

Parameters:
infoCallInfo

Information about the call.

headersdict

A dictionary of headers from the client. Keys are stringsand values are lists of strings (for text headers) orbytes (for binary headers).

Returns:
instanceServerMiddleware

An instance of ServerMiddleware (the instance to use forthe call), or None if this call is not intercepted.

Raises:
exceptionpyarrow.ArrowException

If an exception is raised, the call will be rejected withthe given error.