pyarrow.flight.ServerMiddlewareFactory

class pyarrow.flight.ServerMiddlewareFactory

Bases: pyarrow.lib._Weakrefable

A factory for new middleware instances.

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

__init__()

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

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
  • info (CallInfo) – Information about the call.

  • headers (dict) – A dictionary of headers from the client. Keys are strings and values are lists of strings (for text headers) or bytes (for binary headers).

Returns

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

:raises exception : pyarrow.ArrowException: If an exception is raised, the call will be rejected with the given error.