jina.serve.runtimes.gateway package#
Subpackages#
- jina.serve.runtimes.gateway.composite package
- jina.serve.runtimes.gateway.graph package
- jina.serve.runtimes.gateway.grpc package
- Submodules
- Module contents
GRPCGateway
GRPCGateway.setup_server()
GRPCGateway.shutdown()
GRPCGateway.run_server()
GRPCGateway.dry_run()
GRPCGateway.stream()
GRPCGateway.process_single_data()
GRPCGateway.Call()
GRPCGateway.host
GRPCGateway.is_valid_jaml()
GRPCGateway.load_config()
GRPCGateway.port
GRPCGateway.ports
GRPCGateway.protocols
GRPCGateway.save_config()
- jina.serve.runtimes.gateway.http package
- jina.serve.runtimes.gateway.websocket package
Submodules#
Module contents#
- class jina.serve.runtimes.gateway.GatewayRuntime(args, cancel_event=None, **kwargs)[source]#
Bases:
AsyncNewLoopRuntime
The Gateway Runtime that starts a gateway pod. The GatewayRuntime is associated with a Gateway class that inherits
BaseGateway
. While the Gateway class takes care of server and application logic and serving gRPC/HTTP/Websocket API, The GatewayRuntime is responsible of instantiating the right Gateway class, injecting right parameters to it and running/terminating the Gateway object.- static is_ready(ctrl_address, protocol='grpc', timeout=1.0, **kwargs)[source]#
Check if status is ready.
- Parameters:
ctrl_address (
str
) – the address where the control request needs to be sentprotocol (
Optional
[str
]) – protocol of the gateway runtimetimeout (
float
) – timeout of grpc call in secondskwargs – extra keyword arguments
- Return type:
bool
- Returns:
True if status is ready else False.
- classmethod wait_for_ready_or_shutdown(timeout, ready_or_shutdown_event, ctrl_address, protocol='grpc', **kwargs)[source]#
Check if the runtime has successfully started
- Parameters:
timeout (
Optional
[float
]) – The time to wait before readiness or failure is determinedctrl_address (
str
) – the address where the control message needs to be sentready_or_shutdown_event (
Union
[Event
,Event
]) – the multiprocessing event to detect if the process failed or is readyprotocol (
Optional
[str
]) – protocol of the gateway runtimekwargs – extra keyword arguments
- Returns:
True if is ready or it needs to be shutdown
- aio_tracing_client_interceptors()#
Create a gRPC client aio channel interceptor. :rtype:
Optional
[Sequence
[ClientInterceptor
]] :returns: An invocation-side list of aio interceptor objects.
- aio_tracing_server_interceptors()#
Create a gRPC aio server interceptor. :rtype:
Optional
[Sequence
[ServerInterceptor
]] :returns: A service-side aio interceptor object.
- async cancel_warmup_task()#
Cancel warmup task if exists and is not completed. Cancellation is required if the Flow is being terminated before the task is successful or hasn’t reached the max timeout.
- run_forever()#
Running method to block the main thread.
Run the event loop until a Future is done.
- teardown()#
Call async_teardown() and stop and close the event loop.
- tracing_client_interceptor()#
- Return type:
Optional
[OpenTelemetryClientInterceptor
]- Returns:
a gRPC client interceptor with the global tracing provider.