xmlrpc_extended.asgi¶
ASGI 3-compliant XML-RPC application.
XMLRPCASGIApp¶
XMLRPCASGIApp ¶
XMLRPCASGIApp(*, max_workers: int = _DEFAULT_MAX_WORKERS, max_request_size: int = _DEFAULT_MAX_REQUEST_SIZE, rpc_path: str = _DEFAULT_RPC_PATH, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False)
Bases: SimpleXMLRPCDispatcher
ASGI 3-compliant XML-RPC application.
Inherits :class:~xmlrpc.server.SimpleXMLRPCDispatcher for full
compatibility with the standard registration API. Both async def
and regular synchronous handler functions are supported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_workers
|
int
|
Thread-pool size for synchronous handler functions.
|
_DEFAULT_MAX_WORKERS
|
max_request_size
|
int
|
Maximum accepted request body in bytes.
Requests larger than this receive |
_DEFAULT_MAX_REQUEST_SIZE
|
rpc_path
|
str
|
URL path at which XML-RPC |
_DEFAULT_RPC_PATH
|
allow_none
|
bool
|
Whether |
False
|
encoding
|
str | None
|
XML encoding override; |
None
|
use_builtin_types
|
bool
|
Map XML-RPC |
False
|
Example
Initialise the ASGI application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_workers
|
int
|
Thread-pool size for synchronous handler functions. |
_DEFAULT_MAX_WORKERS
|
max_request_size
|
int
|
Maximum body in bytes (default 1 MiB). |
_DEFAULT_MAX_REQUEST_SIZE
|
rpc_path
|
str
|
URL path accepted for XML-RPC POST requests. |
_DEFAULT_RPC_PATH
|
allow_none
|
bool
|
Allow |
False
|
encoding
|
str | None
|
XML encoding; |
None
|
use_builtin_types
|
bool
|
Map XML types to Python built-ins. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/xmlrpc_extended/asgi.py
__call__
async
¶
ASGI 3 callable entry point.
Dispatches to :meth:_handle_lifespan for lifespan scopes and
:meth:_handle_http for http scopes. Other scope types are
silently ignored to stay forward-compatible with future ASGI extensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
_ASGIScope
|
ASGI connection scope dict. |
required |
receive
|
_ASGIReceive
|
Async callable that yields incoming ASGI events. |
required |
send
|
_ASGISend
|
Async callable for sending ASGI response events. |
required |
Source code in src/xmlrpc_extended/asgi.py
close ¶
Shut down the thread pool gracefully.
Called automatically during the ASGI lifespan shutdown event. Call this explicitly when using the app outside of a lifespan-aware ASGI server (e.g. in tests).