Module rpu.async_.specific
Functions
async def execute_func(func: MaybeAwaitableFunc[P, T], /, *args: P.args, **kwargs: P.kwargs) ‑> T
-
Executes the given function as a function or coro (depending on which it is)
Parameters
func
:MaybeAwaitableFunc[P, T]
- the function/coro to be executed
*args
:typing.Any
- Any positional args to be passed to the function
**kwargs
:typing.Any
- And kwargs to be passed to the function
Returns
Whatever the given function returns
async def run_in_executor(function, *args, **kwargs) ‑> Any
-
|coro|
Runs the given function in a sync executor
Parameters
function
- The sync function to be executed
*args
- Any positional args to be passed to the function
**kwargs
- any kwargs to be passed to the function
Returns
Any
- Whatever the given function returns