jina.serve.runtimes.gateway package#
Subpackages#
- jina.serve.runtimes.gateway.graph package
- jina.serve.runtimes.gateway.grpc package
- Module contents
GRPCGatewayRuntime
GRPCGatewayRuntime.async_setup()
GRPCGatewayRuntime.async_teardown()
GRPCGatewayRuntime.async_cancel()
GRPCGatewayRuntime.async_run_forever()
GRPCGatewayRuntime.dry_run()
GRPCGatewayRuntime.activate()
GRPCGatewayRuntime.is_ready()
GRPCGatewayRuntime.run_forever()
GRPCGatewayRuntime.teardown()
GRPCGatewayRuntime.wait_for_ready_or_shutdown()
- Module contents
- jina.serve.runtimes.gateway.http package
- Submodules
- Module contents
HTTPGatewayRuntime
HTTPGatewayRuntime.async_setup()
HTTPGatewayRuntime.async_run_forever()
HTTPGatewayRuntime.async_teardown()
HTTPGatewayRuntime.async_cancel()
HTTPGatewayRuntime.activate()
HTTPGatewayRuntime.is_ready()
HTTPGatewayRuntime.run_forever()
HTTPGatewayRuntime.teardown()
HTTPGatewayRuntime.wait_for_ready_or_shutdown()
- jina.serve.runtimes.gateway.websocket package
- Submodules
- Module contents
WebSocketGatewayRuntime
WebSocketGatewayRuntime.async_setup()
WebSocketGatewayRuntime.async_run_forever()
WebSocketGatewayRuntime.async_teardown()
WebSocketGatewayRuntime.async_cancel()
WebSocketGatewayRuntime.activate()
WebSocketGatewayRuntime.is_ready()
WebSocketGatewayRuntime.run_forever()
WebSocketGatewayRuntime.teardown()
WebSocketGatewayRuntime.wait_for_ready_or_shutdown()
Submodules#
Module contents#
- class jina.serve.runtimes.gateway.GatewayRuntime(args, cancel_event=None, **kwargs)[source]#
Bases:
AsyncNewLoopRuntime
,ABC
The Runtime from which the GatewayRuntimes need to inherit
- static activate(**kwargs)#
Activate the runtime, does not apply to these runtimes
- Parameters:
kwargs – extra keyword arguments
- abstract async async_cancel()#
An async method to cancel async_run_forever.
- abstract async async_run_forever()#
The async method to run until it is stopped.
- async async_setup()#
The async method to setup.
- async async_teardown()#
The async method to clean up resources during teardown. This method should free all resources allocated during async_setup
- static is_ready(ctrl_address, **kwargs)#
Check if status is ready.
- Parameters:
ctrl_address (
str
) – the address where the control request needs to be sentkwargs – extra keyword arguments
- Return type:
bool
- Returns:
True if status is ready else False.
- 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.
- static wait_for_ready_or_shutdown(timeout, ready_or_shutdown_event, ctrl_address, **kwargs)#
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 readykwargs – extra keyword arguments
- Returns:
True if is ready or it needs to be shutdown