aioplus.awaitify¶
- aioplus.awaitify(func, /, *, executor=None)¶
Make
funcasynchronous.- Parameters:
func (Callable[P, R]) – Callable.
executor (ThreadPoolExecutor, optional) – Executor.
- Returns:
Callable.
- Return type:
Callable[P, Awaitable[R]]
Notes
If
executorisNone, then the default one is used (usually, a thread pool).
Examples
>>> aprint = awaitify(print) >>> await aprint("4 -> 23") 4 -> 23
See also