hypercorn.utils module

exception hypercorn.utils.FrameTooLarge

Bases: Exception

exception hypercorn.utils.LifespanFailure(stage: str, message: str)

Bases: Exception

exception hypercorn.utils.LifespanTimeout(stage: str)

Bases: Exception

exception hypercorn.utils.MustReloadException

Bases: Exception

exception hypercorn.utils.NoAppException

Bases: Exception

exception hypercorn.utils.Shutdown

Bases: Exception

exception hypercorn.utils.UnexpectedMessage(state: enum.Enum, message_type: str)

Bases: Exception

hypercorn.utils.build_and_validate_headers(headers: List[Tuple[bytes, bytes]]) → List[Tuple[bytes, bytes]]
async hypercorn.utils.check_multiprocess_shutdown_event(shutdown_event: multiprocessing.synchronize.Event, sleep: Callable[[float], Awaitable[Any]]) → None
hypercorn.utils.filter_pseudo_headers(headers: List[Tuple[bytes, bytes]]) → List[Tuple[bytes, bytes]]
async hypercorn.utils.invoke_asgi(app: Union[Type[hypercorn.typing.ASGI2Protocol], Callable[[dict, Callable, Callable], Awaitable[None]]], scope: dict, receive: Callable, send: Callable) → None
hypercorn.utils.load_application(path: str) → Union[Type[hypercorn.typing.ASGI2Protocol], Callable[[dict, Callable, Callable], Awaitable[None]]]
async hypercorn.utils.observe_changes(sleep: Callable[[float], Awaitable[Any]]) → None
hypercorn.utils.parse_socket_addr(family: int, address: tuple) → Optional[Tuple[str, int]]
async hypercorn.utils.raise_shutdown(shutdown_event: Callable[[], Awaitable[None]]) → None
hypercorn.utils.repr_socket_addr(family: int, address: tuple) → str
hypercorn.utils.restart() → None
hypercorn.utils.suppress_body(method: str, status_code: int) → bool
hypercorn.utils.valid_server_name(config: hypercorn.config.Config, request: Request) → bool
hypercorn.utils.write_pid_file(pid_path: str) → None