jina.serve.runtimes.gateway.request_handling module#

jina.serve.runtimes.gateway.request_handling.handle_request(graph, connection_pool)[source]#

Function that handles the requests arriving to the gateway. This will be passed to the streamer.

Parameters
  • graph (TopologyGraph) – The TopologyGraph of the Flow.

  • connection_pool (GrpcConnectionPool) – The connection pool to be used to send messages to specific nodes of the graph

Return type

Callable[[ForwardRef], ForwardRef]

Returns

Return a Function that given a Request will return a Future from where to extract the response

jina.serve.runtimes.gateway.request_handling.handle_result(result)[source]#

Function that handles the result when extracted from the request future

Parameters

result (Request) – The result returned to the gateway. It extracts the request to be returned to the client

Returns

Returns a request to be returned to the client