RPC
| from uwsgiconf.runtime.rpc import register_rpc, make_rpc_call, get_rpc_list
@register_rpc()
def expose_me(arg1, arg2=15):
print('RPC called %s' % arg1)
make_rpc_call('expose_me', ['value1'])
all_rpc = get_rpc_list() # Registered RPC items list.
|
Functions
get_rpc_list
| get_rpc_list() -> list[str]
|
Returns registered RPC functions names.
make_rpc_call
| make_rpc_call(
func_name: str, # (1)!
args: Sequence[str] | None = None,
remote: str | None = None
) -> str | None
|
- RPC function name to call.
Performs an RPC function call (local or remote) with the given arguments.
ValueError If unable to call RPC function.
register_rpc
| register_rpc(
name: str | None = None, # (1)!
) -> Callable
|
- RPC function name to associate
with decorated function.
Decorator. Allows registering a function for RPC.
| @register_rpc()
def expose_me(arg1, arg2=15):
print(f'RPC called {arg1}')
return b'some'
make_rpc_call('expose_me', ['value1'])
|
Warning
Function expected to accept bytes args.
Also expected to return bytes or None.