wy_qcos.api package

Subpackages

Submodules

wy_qcos.api.fastapi_coroutine module

class wy_qcos.api.fastapi_coroutine.StoppableService(*args, **kwargs)

基类:Protocol

Protocol for services that can be started and stopped.

async start()

Start the service.

返回类型:

None

async stop()

Stop the service gracefully.

返回类型:

None

class wy_qcos.api.fastapi_coroutine.BackgroundServiceManager

基类:object

Manages the lifecycle of background services.

add_service(service)

Add a background service to the manager.

参数:

service (StoppableService) -- A service object with start() and stop() methods.

返回类型:

None

async start_all()

Start all registered background services.

返回类型:

None

async stop_all()

Stop all background services gracefully.

返回类型:

None

wy_qcos.api.fastapi_coroutine.app_lifespan(app)

FastAPI lifespan manager for background services.

参数:

app (fastapi_jsonrpc.API) -- FastAPI application instance

生成器:

None

wy_qcos.api.fastapi_server module

Module contents